From 6bfd798e2242e12db39be5e7eb94f2c06961bad8 Mon Sep 17 00:00:00 2001 From: Anders Swanson Date: Thu, 6 Nov 2025 11:55:50 -0800 Subject: [PATCH] OKafka Permissions Signed-off-by: Anders Swanson --- code-teq/okafka-lab/oraclefree/grant_permissions.sql | 6 +++++- .../src/main/java/com/example/okafka/CreateTopic.java | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/code-teq/okafka-lab/oraclefree/grant_permissions.sql b/code-teq/okafka-lab/oraclefree/grant_permissions.sql index 227f29360..32e3862db 100644 --- a/code-teq/okafka-lab/oraclefree/grant_permissions.sql +++ b/code-teq/okafka-lab/oraclefree/grant_permissions.sql @@ -1,15 +1,19 @@ -- Set as appropriate for your database. alter session set container = freepdb1; --- user for okafka +-- user for okafka. You may modify tablespace grants as appropriate. create user TESTUSER identified by testpwd; grant create session to TESTUSER; grant resource, connect, unlimited tablespace to TESTUSER; -- okafka permissions +-- AQ User role to be able to use AQ grant aq_user_role to TESTUSER; +-- To be able to invoke operations from AQ-JMS grant execute on dbms_aq to TESTUSER; +-- To be able to create transactional event queue and subscriber grant execute on dbms_aqadm to TESTUSER; +-- To be able to discover other RAC nodes of the database grant select on gv_$session to TESTUSER; grant select on v_$session to TESTUSER; grant select on gv_$instance to TESTUSER; diff --git a/code-teq/okafka-lab/src/main/java/com/example/okafka/CreateTopic.java b/code-teq/okafka-lab/src/main/java/com/example/okafka/CreateTopic.java index efc761618..b6d5ad46f 100644 --- a/code-teq/okafka-lab/src/main/java/com/example/okafka/CreateTopic.java +++ b/code-teq/okafka-lab/src/main/java/com/example/okafka/CreateTopic.java @@ -25,6 +25,7 @@ public static void main(String[] args) { .all() .get(); System.out.println("[ADMIN] Created topic: " + testTopic.name()); + System.out.println("[ADMIN] Created transactional topic: " + transactionalTestTopic.name()); } catch (ExecutionException | InterruptedException e) { if (e.getCause() instanceof TopicExistsException) { System.out.println("[ADMIN] Topic already exists");