[rabbitmq-discuss] temp-queues in STOMP adaptor - missing subscription header

Lionel Cons lionel.cons at cern.ch
Thu Nov 10 06:36:58 GMT 2011

Toby Corkindale writes:
 > I've discovered that the /temp-queue/ feature in rabbitmq's stomp 
 > adaptor causes a problem with at least one STOMP library 
 > (Net::STOMP::Client).
 > This is because the STOMP specification says that a MESSAGE frame must 
 > include a "subscription" header.
 > However, messages sent via a temp-queue do not have this header set.
 > I can understand why not - it's meaningless - however libraries which 
 > insist on frames strictly matching the specification will throw an error 
 > here.


Indeed, Net::STOMP::Client checks that the "subscription" header is
set, as described in the STOMP 1.1 spec.

Since RabbitMQ automatically creates a new subscription (without an
explicit SUBSCRIBE frame) because of the presence of the
reply-to:/temp-queue/foo header in a SEND frame, it would make sense
to use this value (/temp-queue/foo) as the subscription id. After all,
the purpose of this header is to match a received message with
something that the client initiated.

In any case, you can tell Net::STOMP::Client to be less strict about
protocol validation by tuning $Net::STOMP::Client::Frame::CheckLevel.



More information about the rabbitmq-discuss mailing list