rabbitmq-server
rabbitmq-server copied to clipboard
Server-named queues are left behind
I am implementing applications that communicate purely using AMQP 1.0. While I want to use RabbitMQ as AMQP broker, the applications are unaware of rabbitmq entirely.
I use a fanout exchange in RabbitMQ to deliver broadcast messages to all clients. To do so, I subscribe to the AMQP address /exchange/<name of exchange>
. This creates a new queue in RabbitMQ and binds it to the correct exchange. So far, this works and messages arrive at all clients.
However, once a client disconnects, that queue stays around. According to rabbitmq/rabbitmq-amqp1.0#22, this seems intentional, but I don't understand the reasoning:
- Since the queue's name is auto-generated, nobody has the queue name and reconnecting to the queue is impossible.
- Even when the same client reconnects, a new queue is generated.
- The generated queue fills up with messages that will never be received, since nobody will ever connect to it again.
- The queues disappear when RabbitMQ is restarted.
IMO, these queues should be auto-delete. What is the reason that they are not?
Ok so this is for the case where your destination address does not have a queue name segment, e.g. "/exchange/myexchange/" vs "/exchange/myexchange/myqueue".
I think it is reasonable to make server named queues auto-delete. WDYT @dumbbell ?
I am confused. According to the README:
"/exchange/" X "/" RK Consume from temp queue bound to X with routing key RK
I can specify the routing key here (which is not relevant for me), but this doesn't say I can give it a name for the queue. In fact, when I use that syntax, I still get a queue with a generated name ("amq.gen-RANDOM").
my bad, you are quite right they are all server named queues here
@ThomasBaechlerConti you have answered @kjnilsson's question. You shouldn't provide a name with that destination.
It makes sense to use auto-delete queues for that, maybe even exclusive ones.
I agree, it makes sense to make them auto-delete queues.
Hi,
I use AMQP 1.0 and have exactly this problem. Is there any update? For our company it is a bug "yes or no" when it comes to RabbitMQ and AMQP 1.0 that there is active support. At the moment it feels like AMQP 1.0 support is dropped because every ticket I found is 1 to 2 years old and never touched.
Hi, I am having exactly the same issue and I would like to either be able to provide meaningfull queue names and then be able to reconnect to that specific queue or just set it to auto-delete.
Any prospect on fixing this?
Similar concerns here. Is there nothing I can do from the (AMQP 1.0) client side to instruct RabbitMQ to use auto-delete?
This is open source software. Asking others to "fix this" is not how open source works.
Queues can be configured to have a TTL regardless of the client or protocol used.
This is open source software. Asking others to "fix this" is not how open source works.
I assume this remark was directed at @jrk94 and/or @PassionateDeveloper86? Because I was not asking for a fix, I was asking about options.
Queues can be configured to have a TTL regardless of the client or protocol used.
So the solution here is to specify a TTL for "amq.gen*" ?
Applying TTL to ^amq\.gen
should do it (but will affect all server-named queues, of course).