Scope and Recommendation
These breaking changes only affect the AMQP 1.0 protocol. The difference between the AMQP 1.0 and AMQP 0.9.1
is further explained here.
To verify if the AMQP 1.0 protocol is in use, the following command can be executed on the RabbitMQ Service
Instance:
$ rabbitmq-plugins list -e | grep amqp1_0
E*] rabbitmq_amqp1_0 4.1.4
If the AMQP 1.0 protocol is used, all used client libraries must be checked to see if they recognize this change
and set the durable field by default to true, if the message is durable. Otherwise, a message may be sent
without thedurable field specified in the header. Then, this message will be transient, which means it will be
lost in case of any server restart, system crash, or power outage (only with classical queues).
If the field is omitted, the client should not be used. For more details, check this Github page.
Frequently Asked Questions
Are the messages that I push into a durable (classic) queue still durable after the automated update to RabbitMQ
4.2 or are these new messages now transient by default?
Answer: Messages that have been added as durable before the upgrade (no matter if they are durable because the
client set them durable or because the client omitted the durable header field and the server set the message as
durable by default) are still durable. Messages that are added after the update that do not have the durable field
set by the client will be transient by default.
The client libraries I use set the durability field for each message (i.e. with the official clients) - does
this affect me?
Answer: No, if the client sets the durability field for each message, then there is no change in behavior.
What happens after a graceful restart of a RabbitMQ Single Instance , e.g. due to a parameter change, with
transient messages inside of durable (classic) queues? Are those lost or not?
Answer: Messages published as transient will be discarded during reboot, even if they were stored in durable
queues. This is the default behavior of RabbitMQ that has been there before.
What happens after a graceful restart of a RabbitMQ Cluster, e.g. due to a parameter change, with transient
messages inside of durable (classic) queues? Are those lost or not?
Answer: By default, queues are not replicated across cluster nodes. Therefore, messages in these queues are not
replicated either. To replicate queues across nodes in a cluster, use a queue type that supports replication
(e.g. Quorum Queues). With Quorum Queues, your messages will also be replicated across all cluster nodes.
How is the durability specified with AMQP 0.9.1?
Answer: With AMQP 0.9.1, the durability is determined by the message property delivery mode. This is a required
property for each message, therefore nothing changes for the AMQP 0.9.1 protocol. More information about the
message properties for AMQP 0.9.1 can be found here.
Is there any queue type that ensures that messages are durable by default?
Answer: Yes, for Quorum queues, all messages are durable by default, regardless of the message's durability
setting (transient or persistent).
What happens when I combine non-durable (classic) queues with durable messages and vice versa?
Answer: Queues and messages can be durable or transient. The durability setting of the queues does NOT affect the
durability of the messages. A transient message will be lost after a system shutdown, regardless of whether it is
in a durable or a transient queue. For more information about queue and message durability, check the
RabbitMQ documentation about Durability.
The RabbitMQ documentation states here that support for
transient queues will be removed in RabbitMQ 4.0. Why do these changes even matter then?
Answer: There seems to be a discrepancy in the information from the RabbitMQ documentation, as it is still
possible to create transient queues which will also disappear after a restart. A transient queue could be for
example created like this:
rabbitmqadmin declare queue name=my-transient-queue durable=false arguments='{"x-queue-type":"classic"}'
Keep in mind, that this likely to change in the upcoming releases of RabbitMQ.
How can I check if my queues are durable or transient or if I have quorum queues?
Answer: The rabbitmqctl or the rabbitmqadmin CLI tools can be used to check for all queues and their status:
rabbitmqctl list_queues name durable arguments
Timeout: 60.0 seconds ...
Listing queues for vhost / ...
name durable arguments
my-transient-queue false [{"x-queue-type","classic"}]
my-quorum-queue true [{"x-queue-type","quorum"}]
rabbitmqadmin list queues name durable arguments
+--------------------+---------+-----------+
| name | durable | arguments |
+--------------------+---------+-----------+
| my-quorum-queue | True | |
| my-transient-queue | False | |