Skip to content

Commit

Permalink
Changes in example
Browse files Browse the repository at this point in the history
Merge branch 'okafka-23.4.0.0' of https://github.com/oracle/okafka.git
into okafka-23.4.0.0
  • Loading branch information
ichokshi authored and ichokshi committed Aug 5, 2024
1 parent a219857 commit 88ca668
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ To run `OKafka application` against Oracle Database, a database user must be cre

```roomsql
create user <user> identified by <password>
GRANT CONNECT , RESOURCE to user;
GRANT CONNECT , RESOURCE to user;
GRANT UNLIMITED TABLESPACE to user;
GRANT EXECUTE on DBMS_AQ to user;
GRANT EXECUTE on DBMS_AQADM to user;
GRANT EXECUTE on DBMS_AQIN to user;
Expand All @@ -36,6 +37,13 @@ GRANT SELECT on USER_QUEUE_PARTITION_ASSIGNMENT_TABLE to user;
exec DBMS_AQADM.GRANT_PRIV_FOR_RM_PLAN('user');
```

Note:
It is preferred in general to assign or grant a specific quota on a tablespace to a database user instead of granting unlimited quota in default tablespace. One can create a table space and use the following command to grant quota on a specific tablespace to a database user.

```roomsql
ALTER USER user QUOTA UNLIMITED /* or size-clause */ on tablespace_name;
```

Once user is created and above privileges are granted, connect to Oracle Database as this user and create a Transactional Event Queue using below PL/SQL script. One can also use `KafkaAdmin` interface as shown in `CreateTopic.java` in `examples` directory to create a Transactional Event Queue.

```roomsql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,12 @@
import java.io.IOException;
import java.time.Duration;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.clients.consumer.ConsumerRebalanceListener;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.OffsetAndMetadata;
import org.apache.kafka.common.TopicPartition;
import org.junit.Test;
import org.oracle.okafka.clients.consumer.KafkaConsumer;
import org.oracle.okafka.clients.consumer.internals.SubscriptionState;

public class OkafkaAutoOffsetReset {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
import java.time.Duration;
import java.util.Arrays;

import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.common.TopicPartition;
import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.oracle.okafka.clients.consumer.KafkaConsumer;

public class ConsumerOKafka {
public static void main(String[] args) {
Expand Down

0 comments on commit 88ca668

Please sign in to comment.