STOMP Unsubscribe - queue deletion behavior

228 views
Skip to first unread message

Laurent Luce

unread,
Aug 16, 2016, 10:59:18 AM8/16/16
to rabbitmq-users
Hello,

I am observing the following behavior:

SUBSCRIBE /topic/abc with "durable" set to true, "auto-delete" set to false and "x-queue-name" set to "test".
UNSUBSCRIBE with the same headers.  Queue is deleted.

SUBSCRIBE /exchange/abc with "durable" set to true, "auto-delete" set to false and "x-queue-name" set to "test".
UNSUBSCRIBE with the same headers.  Queue is NOT deleted.

I was expecting the same behavior.  Can someone explain why it behaves differently and how I could make sure the queue is deleted when UNSUBSCRIBE is sent with destination: /exchange/abc.

I do not wish the queue to be deleted when the client disconnects, only when it unsubscribes.

Laurent

Michael Klishin

unread,
Aug 16, 2016, 12:26:34 PM8/16/16
to rabbitmq-users
Are there any channel exceptions, in particular with code 406, in the log?

Have you tried inspecting queue properties e.g. via management UI, are they identical in both cases?

I don't think this is intentional but both topic and exchange resources don't really assume long-lived
or user "managed" queues, and x-queue-name with all the property matching dance when unsubscribing
can have confusing aspects.

Laurent Luce

unread,
Sep 22, 2016, 10:42:14 AM9/22/16
to rabbitmq-users
I did not see channel exceptions and the queues seem identical except one is attached to a topic while the other is attached to an exchange.

Looking a the STOMP adapter code, it seems that the behavior matches the code where only topic destinations unsubscribe frames can delete the queue.  Any reason why this was not done for exchange destinations too?

maybe_delete_durable_sub({topic, Name}, Frame,
    If durable: call queue.delete
...
Reply all
Reply to author
Forward
0 new messages