|
| 1 | ++++ |
| 2 | +archetype = "chapter" |
| 3 | +title = "Kafka APIs" |
| 4 | +weight = 2 |
| 5 | ++++ |
| 6 | + |
| 7 | +Oracle Database Transactional Event Queues (TxEventQ) offers comprehensive integration with Apache Kafka, providing developers with a powerful and flexible messaging platform. This module explores the synergy between TxEventQ and Kafka, covering essential concepts and practical implementations. In this module, we'll refer to _queues_ as _topics_ when working with TxEventQ and Kafka. |
| 8 | + |
| 9 | +Throughout this module, we'll explore practical examples using Java code and SQLcl commands to demonstrate: |
| 10 | + |
| 11 | +- Creating and managing topics using Kafka APIs with TxEventQ |
| 12 | +- Producing and consuming messages using Kafka client libraries |
| 13 | +- Implementing transactional messaging with database operations |
| 14 | +- Utilizing Kafka REST APIs for TxEventQ message handling |
| 15 | +- Configuring and using Kafka connectors for TxEventQ |
| 16 | + |
| 17 | +By the end of this module, you'll have a comprehensive understanding of how to leverage Oracle TxEventQ's Kafka compatibility features to build robust, scalable, and event-driven applications. |
| 18 | + |
| 19 | +## Kafka and TxEventQ Concepts |
| 20 | + |
| 21 | +TxEventQ and Kafka share several common architectural concepts, making it easier for developers familiar with Kafka to work with TxEventQ. Key concepts include: |
| 22 | + |
| 23 | +- Topics: Logical channels for message streams |
| 24 | +- Partitions: Subdivisions of topics for parallel processing |
| 25 | +- Offsets: Unique identifiers for messages within a partition |
| 26 | +- Hashing keys: Deterministic message routing within partitions |
| 27 | +- Brokers: Oracle Database servers hosting topics and partitions |
| 28 | +- Ordering: TxEventQ maintains message ordering within partitions, similar to Kafka. Developers can implement partition-level subscribers to ensure ordered message processing. |
| 29 | + |
| 30 | +## Developing with Kafka APIs on TxEventQ |
| 31 | + |
| 32 | +TxEventQ supports Kafka Java APIs through the [Kafka Java Client for Oracle Database Transactional Event Queues](https://github.com/oracle/okafka), allowing developers to leverage existing Kafka knowledge developing against TxEventQ. Key operations include: |
| 33 | + |
| 34 | +- Authenticating to Oracle Database with Kafka APIs |
| 35 | +- Creating topics and partitions using Kafka Admin |
| 36 | +- Producing messages to topics with Kafka Producers |
| 37 | +- Consuming messages from topics using Kafka Consumers |
| 38 | + |
| 39 | +## Kafka Connectors |
| 40 | + |
| 41 | +Oracle offers a Kafka connector for TxeventQ, enabling seamless integration of messages from both platforms. These connectors allow: |
| 42 | + |
| 43 | +- Syncing messages from Kafka topics to TxEventQ queues |
| 44 | +- Sourcing messages from TxEventQ for consumption by Kafka clients |
| 45 | + |
| 46 | +## Transactional Messaging |
| 47 | + |
| 48 | +One of TxEventQ's unique features is its ability to combine messaging and database operations within a single transaction. This capability, often referred to as the "transactional outbox" pattern, ensures data consistency across microservices. We'll explore this pattern through the Kafka Java Client for Oracle Database Transactional Event Queues. |
0 commit comments