You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: txeventq/okafka/Quickstart/README.md
+37-19
Original file line number
Diff line number
Diff line change
@@ -48,14 +48,15 @@ podman run --name=db23aifree \
48
48
## Step 2: Setting database user password
49
49
50
50
All the steps in this lab can either be completed in sqlplus or sqlcl. The instructions refer to sqlcl but apart from the initial connection the two options
51
-
are identical.
51
+
are identical.
52
52
53
53
1. Start by *sql* and connect to the database PDB **FREEPDB1** as SYS
54
54
55
55
```shell
56
56
sql /nolog
57
57
```
58
-
```roomsql
58
+
59
+
```roomsql
59
60
CONNECT sys/"<Your Password>"@localhost:1521/FREEPDB1 as sysdba
> - One can also use `KafkaAdmin` interface as shown in `OKafkaAdminTopic.java` in `Simple/Admin` directory to create a Transactional Event Queue.
101
+
>
102
+
> A Topic can also be created using OKAFKA Administration methods. Or, through the Producer interface which creates a new topic if it was not previously created.
103
+
>
104
+
> - You can also use `KafkaAdmin` interface as shown in `OKafkaAdminTopic.java` in `Simple/Admin` directory to create a Transactional Event Queue.
101
105
102
106
## Step 4: Investigate and Try Simple Producer and Consumer
103
107
104
108
The repository contains 2 common OKafka application examples in `Simple` folder.
105
109
106
110
1. The Producer `ProducerOKafka.java`
107
111
108
-
- Produces 10 messages into `topic_1` topic.
112
+
- Produces 10 messages into `TOPIC_1` topic.
109
113
110
114
2. The Consumer `ConsumerOKafka.java`
111
115
112
-
- Consumes 10 messages from `topic_1` topic.
116
+
- Consumes 10 messages from `TOPIC_1` topic.
113
117
118
+
### Task 1: Applications Configurations
114
119
115
-
###Task 1: Connection Configuration
120
+
####Connection Configuration
116
121
117
122
`OKafka` uses JDBC(thin driver) connection to connect to Oracle Database instance using any one of two security protocols.
118
123
119
-
1. PLAINTEXT
120
-
2. SSL
124
+
1. PLAINTEXT
125
+
2. SSL
121
126
122
127
For this quickstart we will use PLAINTEXT.
123
128
124
129
1.PLAINTEXT: In this protocol a JDBC connection is setup by providing username and password in plain text in ojdbc.prperties file.
125
130
To use PLAINTEXT protocol user must provide following properties through application. Edit file `config.properties` at `<Quickstart Directory>/Simple/[Producer|Consumer]/src/main/resources`
126
131
127
-
security.protocol = "PLAINTEXT"
128
-
bootstrap.servers = "host:port"
129
-
oracle.service.name = "name of the service running on the instance"
130
-
oracle.net.tns_admin = "location of ojdbc.properties file"
132
+
```text
133
+
security.protocol = "PLAINTEXT"
134
+
bootstrap.servers = "host:port"
135
+
oracle.service.name = "name of the service running on the instance"
136
+
oracle.net.tns_admin = "location of ojdbc.properties file"
137
+
```
131
138
132
139
`ojdbc.properties` file must have below properties
133
140
134
-
user(in lowercase)=DatabaseUserName
135
-
password(in lowercase)=Password
141
+
```text
142
+
user(in lowercase)=DatabaseUserName
143
+
password(in lowercase)=Password
144
+
```
145
+
146
+
#### APIs configuration
136
147
148
+
You can get a detailed description of the Producer, Consumer and Administration APIs in the [Kafka APIs for Oracle Transactional Event Queues Documentation](https://docs.oracle.com/en/database/oracle/oracle-database/23/adque/Kafka_cient_interface_TEQ.html#GUID-5549915E-6509-4065-B05E-E96338F4742C).
149
+
150
+
> Note: Topic name property should be provided in UPPERCASE.
151
+
>
152
+
>> ```text
153
+
>> topic.name=<Oracle Database TxEventQ Topic, use uppercase>
154
+
>> ```
137
155
138
156
### Task 2: Try the Producer
139
157
@@ -195,10 +213,10 @@ You should see some output that looks very similar to this:
195
213
13:33:42.413 [kafka-producer-network-thread | ] DEBUG org.oracle.okafka.clients.producer.internals.AQKafkaProducer -- [Producer clientId=] Found a publisher Session_Info:37,53002. Process Id:49814. Instance Name:FREE. Acknowledge_mode:0. for node 0:localhost:1521:FREEPDB1::
196
214
13:33:43.125 [kafka-producer-network-thread | ] INFO org.oracle.okafka.clients.producer.internals.AQKafkaProducer -- [Producer clientId=] In BulkSend: #messages = 1
197
215
13:33:43.711 [kafka-producer-network-thread | ] DEBUG org.oracle.okafka.clients.NetworkClient -- [Producer clientId=] Response Received Produce
0 commit comments