| name | txeventq-examples | |||||
|---|---|---|---|---|---|---|
| description | Java examples for Oracle AI Database Transactional Event Queues using Kafka APIs and PL/SQL. | |||||
| tags |
|
|||||
| blog_post | https://andersswanson.dev/2025/09/18/pub-sub-in-your-db-oracle-database-txeventq/ |
Prerequisites: An Oracle AI Database instance. The examples are configured to use a local, Oracle AI Database Free container running on port 1521, but any 26ai instance will work if configured accordingly.
Like all my samples, you can run it on Oracle AI Database Free
The okafka.sql script creates a table named okafka_messages used to demonstrate transactional messaging capabilities of the OKafka producer.
The OKafkaProducer implements a basic Oracle AI Database Kafka Producer. You can start the producer like so:
mvn compile exec:java -PkafkaproducerThe OKafkaConsumer implements a basic Oracle AI Database Kafka Consumer. You can start the consumer like so:
mvn compile exec:java -PkafkaconsumerThe springjms.sql script contains necessary code to create and start JMS Queue using the dbms_aq package.
The SpringJMSProducer implements a basic Spring JMS producer. You can start the producer like so:
mvn spring-boot:run -PjmsproducerThe SpringJMSConsumer implements a basic Spring JMS consumer. You can start the consumer like so:
mvn spring-boot:run -PjmsconsumerOnce both the producer and consumer are started, you can
To use PL/SQL with TxEventQ, see the PL/SQL example.
To use ORDS with TxEventQ to produce and consume messages, see the ORDS example.