Skip to content

Commit a99d1ae

Browse files
committed
Documentation refresh forAQ
1 parent f2e5ad9 commit a99d1ae

File tree

3 files changed

+87
-41
lines changed

3 files changed

+87
-41
lines changed

doc/src/api_manual/aq.rst

+4
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ AqQueue Properties
6767
- An integer value that defines the position in the queue of the message that is to be dequeued. It can be one of the following constants: :ref:`oracledb.AQ_DEQ_NAV_FIRST_MSG <oracledbconstantsaq>`, :ref:`oracledb.AQ_DEQ_NAV_NEXT_TRANSACTION <oracledbconstantsaq>`, :ref:`oracledb.AQ_DEQ_NAV_NEXT_MSG <oracledbconstantsaq>`.
6868
* - ``transformation``
6969
- A String that defines the transformation that will take place on messages when they are dequeued.
70+
71+
This attribute is not supported in Transactional Event Queues (TxEventQ).
7072
* - ``visibility``
7173
- An integer value that defines whether the dequeue occurs in the current transaction or as a separate transaction. It can be one of the following constants: :ref:`oracledb.AQ_VISIBILITY_IMMEDIATE <oracledbconstantsaq>`, :ref:`oracledb.AQ_VISIBILITY_ON_COMMIT <oracledbconstantsaq>`.
7274
* - ``wait``
@@ -109,6 +111,8 @@ AqQueue Properties
109111
* - ``transformation``
110112
- String
111113
- Defines the transformation that will take place when messages are enqueued.
114+
115+
This attribute is not supported in Transactional Event Queues (TxEventQ).
112116
* - ``visibility``
113117
- Integer
114118
- Defines whether the enqueue occurs in the current transaction or as a separate transaction. It can be one of the following constants: :ref:`oracledb.AQ_VISIBILITY_IMMEDIATE <oracledbconstantsaq>`, :ref:`oracledb.AQ_VISIBILITY_ON_COMMIT <oracledbconstantsaq>`.

doc/src/user_guide/appendix_a.rst

+1-4
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,7 @@ node-oracledb Thin and Thick modes. For more details see :ref:`modediff`.
197197
* - Continuous Query Notification (CQN) (see :ref:`cqn`)
198198
- No
199199
- Yes
200-
* - Advanced Queuing (AQ) (see :ref:`aq`)
201-
- No
202-
- Yes
203-
* - AQ: Transactional Event Queue (TxEventQ)
200+
* - Oracle Transactional Event Queue (TxEventQ) and classic Advanced Queuing (AQ) (see :ref:`aq`)
204201
- No
205202
- Yes
206203
* - Call timeouts (see :attr:`connection.callTimeout`)

doc/src/user_guide/aq.rst

+82-37
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,73 @@
11
.. _aq:
22

3-
**********************************
4-
Using Oracle Advanced Queuing (AQ)
5-
**********************************
6-
7-
Oracle Advanced Queuing allows applications to use producer-consumer
8-
message passing. Queuing is highly configurable and scalable, providing
9-
a great way to distribute workloads. Messages can be queued by multiple
10-
producers. Different consumers can filter messages. Messages can also be
11-
transformed or propagated to queues in other databases. Oracle AQ is
12-
available in all editions of the database, and has interfaces in many
13-
languages, allowing different applications to communicate. For more
14-
details about AQ and its options, refer to the `Oracle Advanced Queuing
15-
User’s Guide <https://www.oracle.com/pls/topic/lookup?ctx=
16-
dblatest&id=ADQUE>`__.
3+
************************************************************
4+
Using Oracle Transactional Event Queues and Advanced Queuing
5+
************************************************************
6+
7+
`Oracle Transactional Event Queues and Advanced Queuing <https://www.oracle.
8+
com/pls/topic/lookup?ctx=dblatest&id=ADQUE>`__ are highly configurable and
9+
scalable messaging features of Oracle Database, providing a great way to
10+
distribute workloads. They allow applications to use producer-consumer message
11+
passing. Messages can be queued by multiple producers. Different consumers can
12+
filter messages. Messages can also be transformed or propagated to queues in
13+
other databases. Oracle Transactional Event Queues (TxEventQ) and Advanced
14+
Queuing (AQ) "Classic" queues have interfaces in many languages, allowing
15+
different applications to communicate. Both TxEventQ and AQ queues support
16+
sending and receiving of various payloads, such as RAW values, JSON, JMS, and
17+
objects. TxEventQ queues use a highly optimized implementation of Advanced
18+
Queuing. They were previously called AQ Sharded Queues.
1719

1820
.. note::
1921

20-
In this release, Oracle AQ is only supported in node-oracledb Thick mode.
21-
See :ref:`enablingthick`.
22+
In this release, TxEventQ and AQ classic queues are only supported in
23+
node-oracledb Thick mode. See :ref:`enablingthick`.
2224

23-
Node-oracledb APIs for AQ were introduced in node-oracledb 4.0. With
24-
earlier versions, use AQ’s PL/SQL interface.
25+
The same node-oracledb APIs are used for TxEventQ and AQ classic queues and
26+
were introduced in node-oracledb 4.0. With earlier versions, use AQ’s PL/SQL
27+
interface.
2528

26-
Oracle Advanced Queues are represented in node-oracledb by several
27-
classes. A single top level :ref:`AqQueue object <aqqueueclass>` in
29+
Both TxEventQ and AQ classic queues are represented in node-oracledb by
30+
several classes. A single top level :ref:`AqQueue object <aqqueueclass>` in
2831
node-oracledb contains :attr:`aqQueue.deqOptions` and
2932
:attr:`aqQueue.enqOptions` object properties which can be used
30-
to change queue behavior. A single AqQueue object can be used for
31-
enqueuing, or dequeuing, or both at the same time.
33+
to change queue behavior. TxEventQ queues do not support the
34+
``transformation`` attribute of :attr:`aqQueue.enqOptions` and
35+
:attr:`aqQueue.deqOptions` properties, and
36+
:ref:`Recipient Lists <aqrecipientlists>`. A single AqQueue object can be
37+
used for enqueuing, or dequeuing, or both at the same time.
3238

3339
Messages are enqueued by passing them to an enqueue method directly, or
3440
by wrapping them in a :meth:`JavaScript object <aqQueue.enqOne()>`. Dequeued
3541
messages are returned as an :ref:`AqMessage object <aqmessageclass>`.
3642

37-
The following examples show how to enqueue and dequeue messages in
38-
node-oracledb. Before using a queue in node-oracledb, it must be created
39-
in the database using the DBMS_AQADM PL/SQL package. For these examples,
43+
There are differences in the payload types supported by TxEventQ and AQ
44+
classic queues as detailed below.
45+
46+
**Classic Advanced Queuing (AQ) Support**
47+
48+
- RAW, named Oracle objects, and JMS payloads are supported.
49+
50+
- The JSON payload requires Oracle Client libraries 21c (or later) and Oracle
51+
Database 21c (or later).
52+
53+
There are examples of AQ Classic Queues in the `GitHub examples
54+
<https://github.com/oracle/node-oracledb/tree/main/examples>`__ directory.
55+
56+
**Transactional Event Queue (TxEventQ) Support**
57+
58+
- RAW and named Oracle object payloads are supported for single and array
59+
message enqueuing and dequeuing when using Oracle Client 19c (or later) and
60+
connected to Oracle Database 19c (or later).
61+
62+
- JMS payloads are supported for single and array message enqueuing and
63+
dequeuing when using Oracle Client 19c (or later) and Oracle Database 23ai.
64+
65+
- JSON payloads are supported for single message enqueuing and dequeuing when
66+
using Oracle Client libraries 21c (or later) and Oracle Database 21c (or
67+
later). Array enqueuing and dequeuing is not supported for JSON payloads.
68+
69+
Before using a queue in node-oracledb, it must be created in the database
70+
using the DBMS_AQADM PL/SQL package. For these examples,
4071
create a new Oracle user ``demoqueue`` with permission to create and use
4172
queues. Connect in SQL*Plus as SYSDBA and run:
4273

@@ -55,8 +86,8 @@ When you have finished testing, remove the DEMOQUEUE schema.
5586
Sending Simple AQ Messages
5687
==========================
5788

58-
You can use AQ to send RAW payloads by using a String or Buffer as the
59-
message.
89+
You can use TxEventQ and classic AQ queues to send RAW payloads by using a
90+
String or Buffer as the message.
6091

6192
Before enqueuing and dequeuing messages, you need to create and start queues
6293
in Oracle Database. For example, to create a queue for simple messaging, use
@@ -91,6 +122,16 @@ attribute to ``oracledb.DB_TYPE_RAW`` in :meth:`connection.getQueue()`::
91122

92123
connection.getQueue(queueName, { payloadType: oracledb.DB_TYPE_RAW });
93124

125+
To create a Transactional Event Queue for RAW payloads:
126+
127+
.. code-block:: sql
128+
129+
BEGIN
130+
DBMS_AQADM.CREATE_SHARDED_QUEUE('RAW_SHQ', QUEUE_PAYLOAD_TYPE=>'RAW');
131+
DBMS_AQADM.START_QUEUE('RAW_SHQ');
132+
END;
133+
/
134+
94135
To enqueue a single, simple message, run:
95136

96137
.. code-block:: javascript
@@ -170,12 +211,12 @@ This will print an identifier like::
170211
Sending Oracle Database JSON AQ Messages
171212
========================================
172213

173-
Starting from Oracle Database 21c, Advanced Queuing supports the JSON
174-
payloads. To use this payload type, the Oracle Client libraries must also be
175-
version 21 or later.
214+
Starting from Oracle Database 21c, Transactional Event Queues (TxEventQ) and
215+
classic Advanced Queuing (AQ) support JSON payloads. To use this payload type,
216+
Oracle Client libraries must also be version 21 or later.
176217

177-
You can use AQ to send JSON payloads by using a JavaScript object as the
178-
message.
218+
You can use TxEventQ and classic AQ to send JSON payloads by using a
219+
JavaScript object as the message.
179220

180221
Before enqueuing and dequeuing messages, you need to create and start queues
181222
in Oracle Database. For example, to create a queue suitable for sending JSON
@@ -650,6 +691,9 @@ This prints::
650691
5. empName : Employee #3
651692
6. empId : 103
652693

694+
Transactional event queues do not support array enqueuing and dequeuing for
695+
JSON payloads.
696+
653697
.. _aqnotifications:
654698

655699
Advanced Queuing Notifications
@@ -699,11 +743,12 @@ database must be able to connect back to node-oracledb.
699743
Recipient Lists
700744
===============
701745

702-
A list of recipient names can be associated with a message at the time a
703-
message is enqueued. This allows a limited set of recipients to dequeue
704-
each message. The recipient list associated with the message overrides
705-
the queue subscriber list, if there is one. The recipient names need not
706-
be in the subscriber list but can be, if desired.
746+
AQ Classic Queues support Recipient Lists. A list of recipient names can be
747+
associated with a message at the time a message is enqueued. This allows a
748+
limited set of recipients to dequeue each message. The recipient list
749+
associated with the message overrides the queue subscriber list, if there is
750+
one. The recipient names need not be in the subscriber list but can be, if
751+
desired.
707752

708753
To dequeue a message, the ``consumerName`` attribute can be set to one
709754
of the recipient names. The original message recipient list is not

0 commit comments

Comments
 (0)