@onlineapps/cookbook-router 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/package.json +1 -1
- package/src/queueManager.js +5 -1
package/README.md
CHANGED
|
@@ -84,6 +84,23 @@ amqplib message properties. One object fed both until d.396d, which meant the
|
|
|
84
84
|
queue was declared with `persistent` and the message published with `durable` —
|
|
85
85
|
neither of which the receiving side reads.
|
|
86
86
|
|
|
87
|
+
A queue limit — how long a message lives, how many the queue holds — is one
|
|
88
|
+
entry of `arguments`, written in the broker's own vocabulary: `x-message-ttl`,
|
|
89
|
+
`x-max-length`. This package translates nothing: `queueOptions` and the per-call
|
|
90
|
+
`options` of `ensureQueue()` are merged and handed to `assertQueue()` as they
|
|
91
|
+
are, so a friendlier spelling such as `maxLength` arrives at the client as a key
|
|
92
|
+
it does not read, and the client refuses it by name rather than dropping it:
|
|
93
|
+
|
|
94
|
+
ensureQueue('quotes.workflow', {
|
|
95
|
+
arguments: { 'x-max-length': 1000, 'x-message-ttl': 60000 }
|
|
96
|
+
})
|
|
97
|
+
→ assertQueue('quotes.workflow', {
|
|
98
|
+
durable: true,
|
|
99
|
+
arguments: { 'x-max-length': 1000, 'x-message-ttl': 60000 }
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
A queue asked for without limits carries no `arguments` key at all.
|
|
103
|
+
|
|
87
104
|
A key not in this table is not read by anything here.
|
|
88
105
|
|
|
89
106
|
## Queue naming
|
package/package.json
CHANGED
package/src/queueManager.js
CHANGED
|
@@ -111,7 +111,11 @@ class QueueManager {
|
|
|
111
111
|
* Ensure queue exists
|
|
112
112
|
* @param {string} queueName - Queue name
|
|
113
113
|
* @param {Object} options - Queue options, as `mqClient.assertQueue()` declares
|
|
114
|
-
* them (`durable`, `arguments`, `exclusive`, `autoDelete`)
|
|
114
|
+
* them (`durable`, `arguments`, `exclusive`, `autoDelete`). A limit is one
|
|
115
|
+
* entry of `arguments`, in the broker's own vocabulary — `x-max-length`,
|
|
116
|
+
* `x-message-ttl`. This class translates no friendlier spelling into one:
|
|
117
|
+
* `maxLength` is a key the client does not read, and since d.396c it says so
|
|
118
|
+
* by name instead of dropping it.
|
|
115
119
|
* @returns {Promise<boolean>}
|
|
116
120
|
*/
|
|
117
121
|
async ensureQueue(queueName, options = {}) {
|