Skip to content

Commit ff0b480

Browse files
Merge pull request #1028 from oracle/txeventq-typos-cleanup
TxEventQ Typos
2 parents 5dce47d + c5ee967 commit ff0b480

File tree

20 files changed

+148
-138
lines changed

20 files changed

+148
-138
lines changed

docs-source/transactional-event-queues/content/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title = "Transactional Event Queues"
55

66
[Oracle Transactional Event Queues (TxEventQ)](https://www.oracle.com/database/advanced-queuing/) is a messaging platform built into Oracle Database that combines the best features of messaging and pub/sub systems. TxEventQ was introduced as a rebranding of AQ Sharded Queues in Oracle Database 21c, evolving from the Advanced Queuing (AQ) technology that has been part of Oracle Database since version 8.0. TxEventQ continues to evolve in Oracle Database 23ai, with [Kafka Java APIs](https://github.com/oracle/okafka), Oracle REST Data Services (ORDS) integration, and many more features and integrations.
77

8-
TxEventQ is designed for high-throughput, reliable messaging in event-driven microservices and workflow applications. It supports multiple publishers and consumers, exactly-once delivery, and robust event streaming capabilities. On an 8-node Oracle Real Application Clusters (RAC) database, TxEventQ can handle approximately 1 million messages per second, demonstrating its scalability.
8+
TxEventQ is designed for high-throughput, reliable messaging in event-driven microservices and workflow applications. It supports multiple publishers and consumers, exactly-once message delivery, and robust event streaming capabilities. On an 8-node Oracle Real Application Clusters (RAC) database, TxEventQ can handle approximately 1 million messages per second, demonstrating its scalability.
99

1010
TxEventQ differs from traditional AQ (now referred to as AQ Classic Queues) in several ways:
1111

docs-source/transactional-event-queues/content/aq-migration/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ weight = 5
66

77
Oracle Database 23ai includes a migration path from Advanced Queuing (AQ) to Transactional Event Queues (TxEventQ), to take advantage of enhanced performance and scalability for event-driven architectures.
88

9+
Advanced Queuing (AQ) has been Oracle’s traditional messaging system for managing asynchronous communication in enterprise applications, allowing reliable queuing and message delivery. TxEventQ leverages Kafka-based event queuing, offering improved throughput, lower latency, and greater scalability, making it ideal for modern event-driven architectures and high-volume event processing.
10+
911
The [DBMS_AQMIGTOOL](https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_AQMIGTOOL.html) package facilitates a smooth migration process, designed to be non-disruptive and allowing the parallel operation of AQ and TxEventQ during the transition, enabling a smooth cut-over with minimal downtime for your applications.
1012

1113
The migration from AQ to TxEventQ is suitable for various scenarios:

docs-source/transactional-event-queues/content/aq-migration/migration.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ title = "AQ Migration"
44
weight = 1
55
+++
66

7-
This section covers the use of the [DBMS_AQMIGTOOL](https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_AQMIGTOOL.html) package for migrating Advanced Queuing (AQ) classic queues to TxEventQ.
7+
8+
This section provides a detailed guide for migrating from Oracle Advanced Queuing (AQ) to Transactional Event Queues (TxEventQ). The migration process uses the [DBMS_AQMIGTOOL](https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_AQMIGTOOL.html) package to ensure minimal disruption of existing messaging workflows.
89

910
Users of AQ are recommended to migrate to TxEventQ for increased support, performance, and access to new database features. It is recommended to read through the document fully before attempting migration.
1011

docs-source/transactional-event-queues/content/getting-started/_index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ This module will cover the following key topics:
1111
## Core Concepts
1212
- Queues and topics
1313
- Enqueue/Dequeue vs. Publish/Subscribe models
14-
- Payload types: RAW, ADT, JSON, and JMS
14+
- Payload types: RAW, Abstract Data Type (ADT), JSON, and JMS
1515

1616
## Queue Management
1717
- Necessary grants, roles, and permissions for using queues
1818
- Creating, starting, stopping, and dropping queues/topics in various languages
19-
- SQLcl examples for queue operations
19+
- SQL examples for queue operations
2020

2121
## Message Operations
2222
- Producing and consuming messages
23-
- Message expiry and exception queues
23+
- Message expiration and exception queues
2424
- Message Delay
2525
- Message Priority
26+
- Transactional messaging: Combining messaging and DML in a single transaction
2627

2728
## Advanced Features
28-
- Transactional messaging: Combining messaging and DML in a single transaction
2929
- Message propagation between queues and databases
3030
- Exception queues and error handling

docs-source/transactional-event-queues/content/getting-started/advanced-features.md

Lines changed: 9 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -4,71 +4,17 @@ title = "Advanced Features"
44
weight = 4
55
+++
66

7-
This section explains advanced features of Transactional Event Queues, including transactional messaging, message propagation between queues and the database, and error handling.
7+
This section explains advanced features of Transactional Event Queues, including message propagation between queues and the database, and error handling.
88

9-
* [Transactional Messaging: Combine Messaging with Database Queries](#transactional-messaging-combine-messaging-with-database-queries)
10-
* [SQL Example](#sql-example)
119
* [Message Propagation](#message-propagation)
1210
* [Queue to Queue Message Propagation](#queue-to-queue-message-propagation)
1311
* [Stopping Queue Propagation](#stopping-queue-propagation)
1412
* [Using Database Links](#using-database-links)
1513
* [Error Handling](#error-handling)
1614

17-
18-
## Transactional Messaging: Combine Messaging with Database Queries
19-
20-
Enqueue and dequeue operations occur within database transactions, allowing developers to combine database queries (DML) with messaging operations. This is particularly useful when the message contains data relevant to other tables or services within your schema.
21-
22-
### SQL Example
23-
24-
In the following example, a DML operation (an `INSERT` query) is combined with an enqueue operation in the same transaction. If the enqueue operation fails, the `INSERT` is rolled back. The orders table serves as the example.
25-
26-
```sql
27-
create table orders (
28-
id number generated always as identity primary key,
29-
product_id number not null,
30-
quantity number not null,
31-
order_date date default sysdate
32-
);
33-
34-
declare
35-
enqueue_options dbms_aq.enqueue_options_t;
36-
message_properties dbms_aq.message_properties_t;
37-
msg_id raw(16);
38-
message json;
39-
body varchar2(200) := '{"product_id": 1, "quantity": 5}';
40-
product_id number;
41-
quantity number;
42-
begin
43-
-- Convert the JSON string to a JSON object
44-
message := json(body);
45-
46-
-- Extract product_id and quantity from the JSON object
47-
product_id := json_value(message, '$.product_id' returning number);
48-
quantity := json_value(message, '$.quantity' returning number);
49-
50-
-- Insert data into the orders table
51-
insert into orders (product_id, quantity)
52-
values (product_id, quantity);
53-
54-
-- Enqueue the message
55-
dbms_aq.enqueue(
56-
queue_name => 'json_queue',
57-
enqueue_options => enqueue_options,
58-
message_properties => message_properties,
59-
payload => message,
60-
msgid => msg_id
61-
);
62-
commit;
63-
end;
64-
/
65-
```
66-
67-
> Note: The same pattern applies to the `dbms_aq.dequeue` procedure, allowing developers to perform DML operations within dequeue transactions.
68-
6915
## Message Propagation
7016

71-
Messages can be propagated within the same database or across a [database link](https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-DATABASE-LINK.html) to different queues or topics. Message propagation is useful for workflows that require message processing d by different consumers or for event-driven actions that need to trigger subsequent processes.
17+
Messages can be propagated within the same database or across a [database link](https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-DATABASE-LINK.html) to different queues or topics. Message propagation is useful for workflows that require processing by different consumers or for event-driven actions that need to trigger subsequent processes.
7218

7319
#### Queue to Queue Message Propagation
7420

@@ -137,7 +83,7 @@ alter system set job_queue_processes=10;
13783

13884
#### Stopping Queue Propagation
13985

140-
You can stop propagation using the DBMS_AQADM.STOP_PROPAGATION procedures:
86+
You can stop propagation using the [DBMS_AQADM.UNSCHEDULE_PROPAGATION](https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/DBMS_AQADM.html#GUID-4B4E25F4-E11F-4063-B1B8-7670C2537F47) procedure:
14187

14288
```sql
14389
begin
@@ -153,14 +99,16 @@ Your can view queue subscribers and propagation schedules from the respective `D
15399

154100
#### Using Database Links
155101

156-
To propagate messages between databases, a [database link](https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-DATABASE-LINK.html) from the local database to the remote database must be created. The subscribe and propagation commands must be altered to use the database link.
102+
To propagate messages between databases, a [database link](https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-DATABASE-LINK.html) from the local database to the remote database must be created. The subscribe and propagation commands must be altered to use the database link.
157103

158104
```sql
159105
begin
160106
dbms_aqadm.schedule_propagation(
161107
queue_name => 'source',
162-
destination => '<database link>.<schema name>', -- replace with your database link and schema name,
163-
destination_queue => 'dest'
108+
-- replace with your database link
109+
destination => 'database_link',
110+
-- replace with your remote schema and queue name
111+
destination_queue => 'schema.queue_name'
164112
);
165113
end;
166114
/
@@ -194,8 +142,8 @@ begin
194142
dbms_output.put_line('message: ' || message_buffer);
195143
exception
196144
when others then
145+
rollback;
197146
dbms_output.put_line('error dequeuing message: ' || sqlerrm);
198147
end;
199148
/
200149
```
201-

docs-source/transactional-event-queues/content/getting-started/core-concepts.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ end;
120120

121121
#### Object
122122

123-
For structured, complex messages, you may choose to set the payload type as a custom object type that was defined using `create type`. Object types must reside in the same schema as the queue/topic, and the structure of each message must exactly match the payload type.
123+
For structured, complex messages, you may choose to set the payload type as a custom object type that was defined using `create type`. Object types must be accessible from the queue/topic, and the structure of each message must exactly match the payload type.
124124

125125
The following SQL script defines a custom object type, and then creates a Transactional Event Queue using that type.
126126

@@ -149,4 +149,6 @@ end;
149149

150150
#### Kafka Message Payloads
151151

152-
Topics created using the Kafka APIs for Transactional Event Queues use a Kafka message payload type, and so specifying the payload type is not necessary. Additionally, topics created using Kafka APIs should also be managed, produced and consumed from using the appropriate Kafka APIs.
152+
Topics created using the Kafka APIs for Transactional Event Queues use a Kafka message payload type, and specifying the payload type is not necessary. Additionally, topics created using Kafka APIs should also be managed and interacted with using the appropriate Kafka APIs.
153+
154+
For more information on using Kafka APIs with TxEventQ, see the [Kafka chapter](../kafka/_index.md).

docs-source/transactional-event-queues/content/getting-started/message-operations.md

Lines changed: 61 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ weight = 3
66

77
This section explains message operations using queues, topics, and different programming interfaces (SQL, Java, Spring JMS, and more). You’ll learn how to enqueue, dequeue, and manage messages effectively.
88

9+
910
* [Enqueue and Dequeue, or Produce and Consume](#enqueue-and-dequeue-or-produce-and-consume)
1011
* [Queues](#queues)
1112
* [Topics](#topics)
@@ -19,6 +20,7 @@ This section explains message operations using queues, topics, and different pro
1920
* [Message Expiry and Exception Queues](#message-expiry-and-exception-queues)
2021
* [Message Delay](#message-delay)
2122
* [Message Priority](#message-priority)
23+
* [Transactional Messaging: Combine Messaging with Database Queries](#transactional-messaging-combine-messaging-with-database-queries)
2224

2325
### Enqueue and Dequeue, or Produce and Consume
2426

@@ -159,7 +161,7 @@ public class SampleProducer<T> implements Runnable, AutoCloseable {
159161

160162
The following Java snippet creates an org.oracle.okafka.clients.consumer.KafkaConsumer instance capable of records from Transactional Event Queue topics. Note the use of Oracle Database connection properties, and Kafka consumer-specific properties like `group.id` and `max.poll.records`.
161163

162-
The org.oracle.okafka.clients.consumer.KafkaConsume class implements the org.apache.kafka.clients.consumer.Consumer interface, allowing it to be used in place of a Kafka Java client consumer.
164+
The org.oracle.okafka.clients.consumer.KafkaConsumer class implements the org.apache.kafka.clients.consumer.Consumer interface, allowing it to be used in place of a Kafka Java client consumer.
163165

164166
```java
165167
Properties props = new Properties();
@@ -181,7 +183,7 @@ props.put("value.deserializer", "org.apache.kafka.common.serialization.StringDes
181183
Consumer<String, String> okafkaConsumer = new KafkaConsumer<>(props);
182184
```
183185

184-
The following Java class consumes messages to a topic, using the [Kafka Java Client for Oracle Database Transactional Event Queues](https://github.com/oracle/okafka). Like the producer example, the consumer only does not use any Oracle classes, only Kafka interfaces.
186+
The following Java class consumes messages from a topic, using the [Kafka Java Client for Oracle Database Transactional Event Queues](https://github.com/oracle/okafka). Like the producer example, the consumer only does not use any Oracle classes, only Kafka interfaces.
185187

186188

187189
```java
@@ -253,7 +255,7 @@ ConnectionFactory cf = AQjmsFactory.getConnectionFactory(ds);
253255
try (Connection conn = cf.createConnection()) {
254256
Session session = conn.createSession();
255257
Queue myQueue = session.createQueue("my_queue");
256-
MessageConsumer consumer = session.createConsumer(queue);
258+
MessageConsumer consumer = session.createConsumer(myQueue);
257259
conn.start();
258260
Message msg = consumer.receive(10000); // Wait for 10 seconds
259261
if (msg != null && msg instanceof TextMessage) {
@@ -336,7 +338,7 @@ begin
336338
message := sys.aq$_jms_text_message.construct();
337339
message.set_text('this is my message');
338340

339-
message_properties.delay := 7*24*60*60; -- Delay for 1 week
341+
message_properties.delay := 7*24*60*60; -- Delay for 7 days
340342
dbms_aq.enqueue(
341343
queue_name => 'my_queue',
342344
enqueue_options => enqueue_options,
@@ -376,4 +378,58 @@ begin
376378
commit;
377379
end;
378380
/
379-
```
381+
```
382+
383+
### Transactional Messaging: Combine Messaging with Database Queries
384+
385+
Enqueue and dequeue operations occur within database transactions, allowing developers to combine database DML with messaging operations. This is particularly useful when the message contains data relevant to other tables or services within your schema.
386+
387+
In the following example, a DML operation (an `INSERT` query) is combined with an enqueue operation in the same transaction. If the enqueue operation fails, the `INSERT` is rolled back. The orders table serves as the example.
388+
389+
```sql
390+
create table orders (
391+
id number generated always as identity primary key,
392+
product_id number not null,
393+
quantity number not null,
394+
order_date date default sysdate
395+
);
396+
397+
declare
398+
enqueue_options dbms_aq.enqueue_options_t;
399+
message_properties dbms_aq.message_properties_t;
400+
msg_id raw(16);
401+
message json;
402+
body varchar2(200) := '{"product_id": 1, "quantity": 5}';
403+
product_id number;
404+
quantity number;
405+
begin
406+
-- Convert the JSON string to a JSON object
407+
message := json(body);
408+
409+
-- Extract product_id and quantity from the JSON object
410+
product_id := json_value(message, '$.product_id' returning number);
411+
quantity := json_value(message, '$.quantity' returning number);
412+
413+
-- Insert data into the orders table
414+
insert into orders (product_id, quantity)
415+
values (product_id, quantity);
416+
417+
-- Enqueue the message
418+
dbms_aq.enqueue(
419+
queue_name => 'json_queue',
420+
enqueue_options => enqueue_options,
421+
message_properties => message_properties,
422+
payload => message,
423+
msgid => msg_id
424+
);
425+
commit;
426+
exception
427+
when others then
428+
-- Rollback the transaction on error
429+
rollback;
430+
dbms_output.put_line('error dequeuing message: ' || sqlerrm);
431+
end;
432+
/
433+
```
434+
435+
> Note: The same pattern applies to the `dbms_aq.dequeue` procedure, allowing developers to perform DML operations within dequeue transactions.

0 commit comments

Comments
 (0)