This sample demonstrates how to stream Oracle AI Database serialized JSON data (OSON) using the kafka-clients compatible OKafka client. The application publishes OSON-serialized events into an Oracle AI Database Transactional Event Queue (TxEventQ) topic and consumes them back into typed Java objects, showcasing an end-to-end JSON pub/sub workflow.
What this sample demonstrates
JSON
Document-shaped data and SQL/JSON querying inside Oracle AI Database.
Use when records need flexible structure without leaving SQL, indexes, constraints, and transactions.
TxEventQ
Transactional queues for database-backed events and messaging.
Use when event delivery and data changes need the same transaction boundary.
Testcontainers
Disposable Oracle AI Database Free containers for repeatable local and integration tests.
Use when tests need real database behavior without sharing a long-lived development instance.
Kafka
Kafka-compatible eventing and migration paths backed by Oracle AI Database queues.
Use when comparing separate-broker designs or moving Kafka-shaped workloads toward database-native eventing.
Highlights
- An Application class that creates an OKafka topic, publishes sample JSON payloads serialized with Oracle OSON, and consumes them back via the OKafka consumer API.
- A reusable OSON serializer/deserializer built on Oracle's JSONB binding so you can work with plain Java POJOs while benefiting from Oracle's binary JSON format.
- Integration tests powered by Testcontainers that spin up Oracle AI Database Free, provision the TxEventQ topic, and validate the producer/consumer loop.