[rabbitmq-discuss] Cannot send message with STOMP

Lionel Cons Lionel.Cons at cern.ch
Mon Apr 16 16:18:32 BST 2012


Thanks for your reply.

Since RabbitMQ does not report any error back to the client and does not record anything in its logs either, it’s hard to find out what really happens. IMHO, if RabbitMQ thinks something is wrong, it should clearly say so.

Back to my test, the protocol used is STOMP 1.0 (RabbitMQ correctly reports it in its CONNECTED frame). There is no escaping defined in STOMP 1.0 so RabbitMQ should IMHO not perform any (de)escaping.

If escaping is indeed the source of the problem, could one please consider:

-          Logging errors coming from incorrect escaping

-          Not performing STOMP 1.1 (de)escaping on STOMP 1.0 connections



From: tonygarnockjones at gmail.com [mailto:tonygarnockjones at gmail.com] On Behalf Of Tony Garnock-Jones
Sent: Monday, April 16, 2012 4:19 PM
To: Lionel Cons
Cc: rabbitmq-discuss at lists.rabbitmq.com
Subject: Re: [rabbitmq-discuss] Cannot send message with STOMP

It's probably the backslashes in the headers that you're sending. Because STOMP's syntax forbids linefeeds and colons not only in header names but also in header values (!!), RabbitMQ's STOMP codec uses backslash escaping (for the values only, I note), which isn't part of the specification.

Even though you're not sending colons in header values, you're being affected by the escaping. STOMP's syntax plus RabbitMQ's ad-hoc escaping then are two wrongs that definitely don't make a right :-(

STOMP's syntax, terrible though it is, is set in stone, so I guess the only hope left is some tweak to or removal of the backslash escaping mechanism in the RabbitMQ codec. I'm at a loss as to what the right thing to do here is. (Besides fix STOMP, obviously.)

One option would be to do no escaping, but if a header is about to be encoded using some illegal character (i.e. LF or colon), encode it using some totally nonstandard but also totally unambiguous format such as a colon in the first column of the line followed by two netstrings? It'd completely crash any parser that wasn't looking out for it, because it's illegal syntax, but then so is including an unescaped colon or LF in the first place, so we're already into uncharted territory.

:4:what,17:a terrible design,

A middle ground would be to forbid sending colons in header *names* but silently pass them on in header *values* (they're harmless, and it's a silly restriction), and if a LF were seen, to encode it as LF-colon. A naive parser then would see a pseudo-header with an empty name; parsers expecting this convention would understand it to be a header value continuation from the previous line.

Any way you slice it, though: yuck.


On 16 April 2012 09:42, Lionel Cons <lionel.cons at cern.ch<mailto:lionel.cons at cern.ch>> wrote:
It seems I cannot send _some_ messages using STOMP. After investigation,
this seems to come from the presence of "exotic" characters in the header.

I managed to reproduce the problem with netcat and the attached file.

When I try to use the file to send the message, I get nothing back:

$ (cat frame; sleep 1) | nc broker 6123

If I remove the two header lines starting with rnd-, it does work as

$ (cat frame.clean; sleep 1) | nc broker 6123


So it seems that RabbitMQ does not like these header lines... Any idea on
what is happening?



rabbitmq-discuss mailing list
rabbitmq-discuss at lists.rabbitmq.com<mailto:rabbitmq-discuss at lists.rabbitmq.com>

Tony Garnock-Jones
tonygarnockjones at gmail.com<mailto:tonygarnockjones at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120416/34664c31/attachment.htm>

More information about the rabbitmq-discuss mailing list