[rabbitmq-discuss] STOMP & message-id

Matthias Radestock matthias at rabbitmq.com
Mon Aug 22 10:43:35 BST 2011


On 22/08/11 10:15, Lionel Cons wrote:
> I've tried to send a message that contained a message-id to RabbitMQ's
> STOMP interface and it got rejected with an error: Invalid message-id.

Are you sure you got this error during sending? Looking at the code, 
that error should only be generated in the (N)ACK path.

> This (i.e. client supplied message-id) can happen when you shovel
> messages from one broker to another.
> IMHO, there are two ways for the broker to handle this:
> 1) ignore this header and always set a "unique" message-id, like in
>     the case this header is not set
> 2) use this header as provided by the client
> If the expected behavior is 2), RabbitMQ should IMHO be liberal in
> what it accepts as message-id so that messages coming from other
> brokers can be shoveled easily. If there are restrictions, they should
> be clearly documented.

The STOMP specification defines the usage of message-id headers for 
MESSAGE frames and N(ACK) frames. It says nothing about how message-ids 
in SEND frames should be treated, or, rather, it says nothing about how 
in general SEND headers should be treated that clash with 
protocol-defined headers in MESSAGE frames.

 From a quick glance at the code I cannot tell what rabbit actually does 
with sender-supplied message-ids. I suspect it either stomps on the 
existing id on delivery or the message ends up with two ids.

One thing is certain though, Rabbit cannot simply pass through the 
message-id. That is because Rabbit encodes information in the message-id 
that it subsequently needs for processing (N)ACKS.



More information about the rabbitmq-discuss mailing list