[rabbitmq-discuss] [PATCH] Add exclusive queue support to stomp adaptor
Jeff
threshar at torgo.978.org
Mon Mar 26 14:28:20 BST 2012
On Mar 26, 2012, at 9:09 AM, Steve Powell wrote:
>
> In RabbitMQ's implementation of a STOMP subscription, the format of the
> destination determines whether there is a queue, what it might be
> called, and whether it is created exclusive or not to this client.
> Subscriptions to Topic destinations, for example, are associated with
> exclusive queues, created for each subscriber. Subscriptions to simple
> queue destinations create a shared queue (of an appropriate name) mainly
> because we are expecting some other STOMP client to SEND to it (or it
> might already have sent to it); making it exclusive would prevent other
> clients from seeing it and thus defeat the object.
>
> What we cannot understand is why you would want to change the normal
> exclusive/shared characteristic of a queue we might create from the
> default? Can you explain why you might want this feature?
>
We're using Net::Stomp because I encountered a ton of problems getting Net::AMQP to work correctly. (that and Net::Stomp's api is vastly simpler than Net::AMQP)
So we needed to setup some mirrored, persistent queues and there was no way, from what I could see, with stomp to create a mirrored queue. So, we create the queue via the web-ui and access via /amq/queue/xxxx. This was all fine until recently when I needed to ensure there was only a single consumer of a queue. I looked around trying to see how I can set the exclusivity and ended up in the code for the stomp adaptor and ended up with the aforementioned patch. (Net::Stomp has an activemq specific extension to allow exclusive consumers, so I whipped up an extension for Rabbit)
It boils down to I needed to create and access mirrored queues using a stomp client.
It does look like /queue/ would do the exclusive access (not sure from the docs - it just says message will be delivered to one subscriber, not sure if that means it'll block out other subscribers or distribute among connected subscribers).
thanks
> Steve Powell (a puzzled bunny)
> ----------some more definitions from the SPD----------
> chinchilla (n.) Cooling device for the lower jaw.
> socialcast (n.) Someone to whom everyone is speaking but nobody likes.
> literacy (n.) A textually transmitted disease usually contracted in childhood.
>
> On 23 Mar 2012, at 12:31, Steve Powell wrote:
>
>> Thanks for the patch Jeff,
>>
>> We are evaluating this.
>>
>> Steve Powell (a happy bunny)
>> ----------some more definitions from the SPD----------
>> chinchilla (n.) Cooling device for the lower jaw.
>> socialcast (n.) Someone to whom everyone is speaking but nobody likes.
>> literacy (n.) A textually transmitted disease usually contracted in childhood.
>>
>> On 21 Mar 2012, at 17:24, Jeff wrote:
>>
>>> this is a very small patch to add exclusive-access support to a queue when accessed via the stomp adaptor. It is enabled by using the "exclusive" header.
>>>
>>> If you are using Net::Stomp your subscribe would look like
>>>
>>> $stomp->subscribe({ "destination" => "/amq/queue/test",
>>> "ack" => "auto",
>>> "exclusive" => "true"
>>> }));
>>>
>>>
>>> <rabbit-2.7.1-exclusive-stomp.diff>
>>>
>>> --
>>> Jeff Trout <jeff at jefftrout.com>
>>> http://www.stuarthamm.net/
>>> http://www.dellsmartexitin.com/
>>>
>>>
>>>
>>> _______________________________________________
>>> rabbitmq-discuss mailing list
>>> rabbitmq-discuss at lists.rabbitmq.com
>>> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>>
>> _______________________________________________
>> rabbitmq-discuss mailing list
>> rabbitmq-discuss at lists.rabbitmq.com
>> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
--
Jeff Trout <jeff at jefftrout.com>
http://www.stuarthamm.net/
http://www.dellsmartexitin.com/
More information about the rabbitmq-discuss
mailing list