RabbitMQ difference between exclusive and auto-delete?

后端 未结 2 1659
时光说笑
时光说笑 2021-01-30 06:37

The \"RabbitMQ in Action\" book on page 19 gives these descriptions of exclusive and auto-delete:

exclusive - When set to true, your queue becomes private

2条回答
  •  庸人自扰
    2021-01-30 07:26

    In contrast to what theMayer described, my testing showed that there is a difference in behavior when auto-delete is toggled while exclusive is set to true.

    If auto-delete is set to false, the queue is indeed tied to the connection and will disappear when the connection is terminated.

    If auto-delete is set to true, the queue will be deleted after the last consumer is cancelled.

    There is a difference between a connection and a consumer. You can be connected, but not consuming a given queue. If you need the queue's lifecycle to be tied to your connection rather than to whether or not you're actively consuming it, set auto-delete to false in conjunction with exclusive=true.

提交回复
热议问题