Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

name txeventq-examples
description Java examples for Oracle AI Database Transactional Event Queues using Kafka APIs and PL/SQL.
tags
Database
Java
Kafka
PL/SQL
TxEventQ
blog_post https://andersswanson.dev/2025/09/18/pub-sub-in-your-db-oracle-database-txeventq/

Oracle AI Database Transactional Event Queues Examples

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 -Pkafkaproducer

The OKafkaConsumer implements a basic Oracle AI Database Kafka Consumer. You can start the consumer like so:

mvn compile exec:java -Pkafkaconsumer

Spring JMS

The 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 -Pjmsproducer

The SpringJMSConsumer implements a basic Spring JMS consumer. You can start the consumer like so:

mvn spring-boot:run -Pjmsconsumer

Once both the producer and consumer are started, you can

PL/SQL

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.