@@ -563,6 +563,7 @@ For installation information, see the [Node-oracledb Installation Instructions][
563
563
- 27.3 [Changing AQ options](#aqoptions)
564
564
- 27.4 [Enqueuing and Dequeuing Multiple Messages](#aqmultiplemessages)
565
565
- 27.5 [Advanced Queuing Notifications](#aqnotifications)
566
+ - 27.6 [Recipient Lists](#aqrecipientlists)
566
567
28. [Globalization and National Language Support (NLS)](#nls)
567
568
29. [End-to-end Tracing, Mid-tier Authentication, and Auditing](#endtoend)
568
569
30. [Simple Oracle Document Access (SODA)](#sodaoverview)
@@ -5941,9 +5942,11 @@ some attributes controlling the behavior of the queued message.
5941
5942
`expiration` | The number of seconds the message is available to be dequeued before it expires.
5942
5943
`payload` | A String, Buffer or [DbObject](#dbobjectclass) that is the actual message to be queued. This property must be specified.
5943
5944
`priority` | An integer priority of the message.
5945
+ `recipients` | An array of strings where each string is a recipients name.
5944
5946
5945
5947
See [Oracle Advanced Queuing Documentation][129] for more information about attributes.
5946
5948
5949
+ The `recipients` attribute was added in node-oracledb 5.5.
5947
5950
5948
5951
- ```
5949
5952
function(Error error)
@@ -16532,6 +16535,44 @@ about subscriptions and notifications.
16532
16535
AQ notifications require the same configuration as CQN. Specifically
16533
16536
the database must be able to connect back to node-oracledb.
16534
16537
16538
+ ### <a name="aqrecipientlists"></a> 27.6 Recipient Lists
16539
+
16540
+ A list of recipient names can be associated with a message at the time a
16541
+ message is enqueued. This allows a limited set of recipients to dequeue each
16542
+ message. The recipient list associated with the message overrides the queue
16543
+ subscriber list, if there is one. The recipient names need not be in the
16544
+ subscriber list but can be, if desired.
16545
+
16546
+ To dequeue a message, the `consumerName` attribute can be set to one of the
16547
+ recipient names. The original message recipient list is not available on
16548
+ dequeued messages. All recipients have to dequeue a message before it gets
16549
+ removed from the queue.
16550
+
16551
+ Subscribing to a queue is like subscribing to a magazine: each subscriber can
16552
+ dequeue all the messages placed into a specific queue, just as each magazine
16553
+ subscriber has access to all its articles. Being a recipient, however, is like
16554
+ getting a letter: each recipient is a designated target of a particular
16555
+ message.
16556
+
16557
+ For example, to enqueue a message meant for "payroll" recipients:
16558
+
16559
+ ```
16560
+ await queue.enqOne({
16561
+ payload: "Message 1",
16562
+ recipients: [ "payroll" ]
16563
+ });
16564
+ ```
16565
+
16566
+ Later, when dequeuing messages, the "payroll" recipient can be set using the
16567
+ `consumerName` property to get the message:
16568
+
16569
+ ```
16570
+ Object.assign(
16571
+ queue.deqOptions,
16572
+ { consumerName: "payroll" }
16573
+ );
16574
+ const msg = await queue.deqOne();
16575
+ ```
16535
16576
16536
16577
## <a name="nls"></a> 28. Globalization and National Language Support (NLS)
16537
16578
0 commit comments