Skip to content

Commit

Permalink
Merge branch 'okafka-23.4.0.0' into okafka-example-23.4
Browse files Browse the repository at this point in the history
  • Loading branch information
pasimoes authored Aug 15, 2024
2 parents a0b5fba + 88ca668 commit 3415f48
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ To run `OKafka application` against Oracle Database, a database user must be cre

```roomsql
create user <user> identified by <password>
GRANT AQ_USER_ROLE to user;
GRANT CONNECT, RESOURCE, unlimited tablespace to user;
GRANT EXECUTE on DBMS_AQ to user;
Expand All @@ -38,6 +39,13 @@ GRANT SELECT on SYS.DBA_RSRC_PLAN_DIRECTIVES 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 @@ -16,8 +16,10 @@

import org.oracle.okafka.clients.consumer.KafkaConsumer;

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

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

0 comments on commit 3415f48

Please sign in to comment.