Skip to content

Commit

Permalink
Classic and QQ SAC section wording
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed Jan 26, 2023
1 parent b84c095 commit 1aa2b79
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions site/consumers.md
Expand Up @@ -458,6 +458,15 @@ A typical sequence of events would be the following:
Note that without the single active consumer feature enabled, messages
would be dispatched to all consumers using round-robin.

Please note: this section covers the single active consumer that's available to AMQP 0-9-1 and AMQP 1.0 clients
on classic and quorum queues. It is not related to [Single Active Consumer on streams](https://rabbitmq.com/streams.html#single-active-consumer).

An attempt to enable SAC using an AMQP 0-9-1 client on a stream **will not work**.
To use SAC on a stream, a [native RabbitMQ stream protocol client](https://rabbitmq.github.io/rabbitmq-stream-java-client/snapshot/htmlsingle/#single-active-consumer)
must be used.

### Enabling Single Active Consumer on Quorum and Classic Queues

Single active consumer can be enabled when declaring a queue, with the
`x-single-active-consumer` argument set to `true`, e.g. with the Java client:

Expand All @@ -468,16 +477,22 @@ arguments.put("x-single-active-consumer", true);
ch.queueDeclare("my-queue", false, false, false, arguments);
</pre>

Compared to [AMQP exclusive consumer](#exclusivity), single active consumer puts
### Difference from Exclusive Consumers

Compared to [AMQP 0-9-1 exclusive consumer](#exclusivity), single active consumer puts
less pressure on the application side to maintain consumption continuity.
Consumers just need to be registered and failover is handled automatically,
there's no need to detect the active consumer failure and to register
a new consumer.

### Determining Which Consumer is Currently Active

The [management UI](./management.html) and the
[CLI](./rabbitmqctl.8.html) can [report](#active-consumer) which consumer is the current
active one on a queue where the feature is enabled.

### SAC Behavior

Please note the following about single active consumer:

* There's no guarantee on the selected active consumer, it is
Expand All @@ -501,12 +516,6 @@ Please note the following about single active consumer:
of single active consumer do not play well with the dynamic nature of policies,
this feature can be enabled only when declaring a queue, with queue arguments.

Please note: this guide is for AMQP single active consumer. It is not related to
[RabbitMQ Streams Single Active Consumer](https://rabbitmq.com/streams.html#single-active-consumer).
Setting a single active consumer, using an AMQP client, on a queue type 'stream' will
not enable SAC. To use SAC on Streams, you have to use a native Stream Client,
like the [RabbitMQ Java Stream client](https://rabbitmq.github.io/rabbitmq-stream-java-client/snapshot/htmlsingle/#single-active-consumer).

## <a id="active-consumer" class="anchor" href="#active-consumer">Consumer Activity</a>

The [management UI](./management.html) and the `list_consumers`
Expand Down

0 comments on commit 1aa2b79

Please sign in to comment.