Skip to content

Commit 8652f1b

Browse files
Merge branch 'qq-delivery-limit-update'
2 parents 69344de + 4a2c82b commit 8652f1b

File tree

3 files changed

+85
-12
lines changed

3 files changed

+85
-12
lines changed

docs/queues.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,16 @@ The map is used by various features and plugins such as
145145
* Queue type (e.g. [quorum](./quorum-queues) or [classic](./classic-queues))
146146
* [Message and queue TTL](./ttl)
147147
* [Queue length limit](./maxlength)
148-
* Max number of [priorities](./priority)
149-
* [Consumer priorities](./consumer-priority)
148+
* Quorum queue [redelivery limit](./quorum-queues#poison-message-handling)
149+
* Max number of [priorities](./priority) of a classic queue
150150

151151
and so on.
152152

153+
The same idea is also used with other protocol operations, for example, when
154+
registering a consumer:
155+
156+
* [Consumer priorities](./consumer-priority)
157+
153158
Most optional arguments can be dynamically changed after queue declaration but there are
154159
exceptions. For example, [queue type](./quorum-queues) (`x-queue-type`) and max number
155160
of [queue priorities](./priority) (`x-max-priority`) must be set at queue declaration time

docs/quorum-queues/index.md

+71-8
Original file line numberDiff line numberDiff line change
@@ -359,14 +359,21 @@ dropped messages are retained for some time after.
359359
:::important
360360

361361
Starting with RabbitMQ 4.0, the delivery limit for quorum queues defaults to 20.
362-
There is no way to set it to the old, unlimited default.
362+
363+
The 3.13.x era behavior where there was no lilmit can be restored by setting the limit to `-1`
364+
using an [optional queue argument](./queues#optional-arguments) at declaration time or using a policy as demonstrated below.
365+
363366

364367
:::
365368

369+
See [repeated requeues](#repeated-requeues) for more details.
370+
366371
### Configuring the Limit {#position-message-handling-configuring-limit}
367372

368373
It is possible to set a delivery limit for a queue using a [policy](./parameters#policies) argument, `delivery-limit`.
369374

375+
#### Overriding the Limit
376+
370377
The following example sets the limit to 50 for queues whose names begin with
371378
`qq`.
372379

@@ -421,6 +428,62 @@ PUT /api/policies/%2f/qq-overrides
421428
</TabItem>
422429
</Tabs>
423430

431+
#### Disaling the Limit
432+
433+
The following example disables the limit for queues whose names begin with
434+
`qq.unlimited`.
435+
436+
<Tabs groupId="shell-specific">
437+
<TabItem value="bash" label="bash" default>
438+
```bash
439+
rabbitmqctl set_policy qq-overrides \
440+
"^qq\.unlimited" '{"delivery-limit": -1}' \
441+
--priority 20 \
442+
--apply-to "quorum_queues"
443+
```
444+
</TabItem>
445+
446+
<TabItem value="PowerShell" label="PowerShell">
447+
```PowerShell
448+
rabbitmqctl.bat set_policy qq-overrides ^
449+
"^qq\.unlimited" "{""delivery-limit"": -1}" ^
450+
--priority 20 ^
451+
--apply-to "quorum_queues"
452+
```
453+
</TabItem>
454+
455+
<TabItem value="HTTP API" label="HTTP API">
456+
```ini
457+
PUT /api/policies/%2f/qq-overrides
458+
{"pattern": "^qq\.unlimited",
459+
"definition": {"delivery-limit": -1},
460+
"priority": 1,
461+
"apply-to": "quorum_queues"}
462+
```
463+
</TabItem>
464+
465+
<TabItem value="Management UI" label="Management UI">
466+
<ol>
467+
<li>
468+
Navigate to `Admin` > `Policies` > `Add / update a
469+
policy`.
470+
</li>
471+
<li>
472+
Enter a policy name (such as "qq-overrides") next to Name, a pattern (such as "^qq\.unlimited") next to
473+
Pattern, and select what kind of entities (quorum queues in this example) the policy should apply to using the `Apply to`
474+
drop down.
475+
</li>
476+
<li>
477+
Enter "delivery-limit" for policy argument and -1 for its value in the first line next to
478+
`Policy`.
479+
</li>
480+
<li>
481+
Click `Add policy`.
482+
</li>
483+
</ol>
484+
</TabItem>
485+
</Tabs>
486+
424487
### Configuring the Limit and Setting Up Dead-Lettering {#position-message-handling-configuring-dlx}
425488

426489
Messages that are redelivered more times than the limit allows for will be either dropped (removed) or [dead-lettered](./dlx).
@@ -1110,17 +1173,17 @@ truncated regularly. To be able to truncate a section of the log all messages
11101173
in that section needs to be acknowledged. Usage patterns that continuously
11111174
[reject or nack](./nack) the same message with the `requeue` flag set to true
11121175
could cause the log to grow in an unbounded fashion and eventually fill
1113-
up the disks. Therefore since RabbitMQ 4.0 a default `delivery-limit` of 20 is always set
1114-
after which the message will be dropped or dead lettered.
1176+
up the disks. Therefore since RabbitMQ 4.0 a default `delivery-limit` of 20 is
1177+
always set after which the message will be dropped or dead lettered.
11151178

11161179
Messages that are rejected or nacked back to a quorum queue will be
11171180
returned to the _back_ of the queue _if_ no [delivery-limit](#poison-message-handling) is set.
1118-
This avoids
1119-
the above scenario where repeated re-queues causes the Raft log to grow in an
1120-
unbounded manner. If a `delivery-limit` is set it will use the original behaviour
1181+
This avoids the above scenario where repeated re-queues causes the Raft log to grow in an unbounded manner. If a `delivery-limit` is set it will use the original behaviour
11211182
of returning the message near the head of the queue.
1122-
(NB: since 4.0 a delivery-limit will only be unset _if_ a queue was upgraded
1123-
from a prior version, newly declared queues will always have a default of 20).
1183+
1184+
The old unlimited delivery-limit behaviour can be restored by setting a queue
1185+
argument or policy with a delivery limit of -1. It is not recommended to do
1186+
so but may be needed for 3.13.x compatibility in some rare cases.
11241187

11251188
### Increased Atom Use {#atom-use}
11261189

versioned_docs/version-3.13/queues.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,16 @@ The map is used by various features and plugins such as
144144
* Queue type (e.g. [quorum](./quorum-queues) or [classic](./classic-queues))
145145
* [Message and queue TTL](./ttl)
146146
* [Queue length limit](./maxlength)
147-
* Max number of [priorities](./priority)
148-
* [Consumer priorities](./consumer-priority)
147+
* Quorum queue [redelivery limit](./quorum-queues#poison-message-handling)
148+
* Max number of [priorities](./priority) of a classic queue
149149

150150
and so on.
151151

152+
The same idea is also used with other protocol operations, for example, when
153+
registering a consumer:
154+
155+
* [Consumer priorities](./consumer-priority)
156+
152157
Most optional arguments can be dynamically changed after queue declaration but there are
153158
exceptions. For example, [queue type](./quorum-queues) (`x-queue-type`) and max number
154159
of [queue priorities](./priority) (`x-max-priority`) must be set at queue declaration time

0 commit comments

Comments
 (0)