rabbitmq / rabbitmq-server

Open source RabbitMQ: core server and tier 1 (built-in) plugins
https://www.rabbitmq.com/
Other
11.9k stars 3.9k forks source link

Server-named queues are left behind #2588

Open ThomasBaechlerConti opened 5 years ago

ThomasBaechlerConti commented 5 years ago

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:

IMO, these queues should be auto-delete. What is the reason that they are not?

kjnilsson commented 5 years ago

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 ?

ThomasBaechlerConti commented 5 years ago

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").

kjnilsson commented 5 years ago

my bad, you are quite right they are all server named queues here

michaelklishin commented 5 years ago

@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.

dumbbell commented 5 years ago

I agree, it makes sense to make them auto-delete queues.

PassionateDeveloper86 commented 3 years ago

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.

jrk94 commented 2 years ago

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?

petertiedemann commented 2 years ago

Similar concerns here. Is there nothing I can do from the (AMQP 1.0) client side to instruct RabbitMQ to use auto-delete?

michaelklishin commented 2 years ago

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.

petertiedemann commented 2 years ago

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*" ?

michaelklishin commented 2 years ago

Applying TTL to ^amq\.gen should do it (but will affect all server-named queues, of course).