[rabbitmq-discuss] STOMP 1.1 CONNECT header problem

Matthias Radestock matthias at rabbitmq.com
Thu Jun 28 18:35:41 BST 2012


Michael,

Michael Justin wrote:
> for this CONNECT frame
> 
> CONNECT
> login:guest
> passcode:guest
> accept-version:1.1
> host:localhost
> 
> the RabbitMQ 2.8.4 server responds:
> 
> ERROR
> message:Bad CONNECT
> content-type:text/plain
> version:1.0,1.1
> content-length:23
> 
> And if the client sends 'server' instead of 'host':
> 
> CONNECT
> login:guest
> passcode:guest
> accept-version:1.1
> server:localhost
> 
> the server accepts the connection:
> 
> CONNECTED
> session:session-API2OcjBv_NK11_v0yuppC
> heart-beat:0,0
> server:RabbitMQ/2.8.4
> version:1.1
> 
> The specification says there must be a 'host' header in the CONNECT 
> frame: 
> http://stomp.github.com/stomp-specification-1.1.html#CONNECT_or_STOMP_Frame
> 
> but RabbitMQ expects a 'server' header property instead. Is this a bug?

RabbitMQ does *not* expect a 'server' header. The difference in the 
above is purely due to whether a 'host' header was specified or not.

The reason the first attempt fails is that the specified host is not a 
virtual host known to your rabbit. RabbitMQ ships with just one vhost, 
called '/', pre-configured. That's also what is chosen as the default 
when no 'host' header is specified in the CONNECT.

We should document this better. I have filed a bug.

While accepting a CONNECT w/o a 'host' header is technically a violation 
of the STOMP 1.1 spec, I don't think it does any harm and it means we 
can keep the CONNECT handling code version agnostic (STOMP 1.0's CONNECT 
does not have a 'host' header).


Matthias


More information about the rabbitmq-discuss mailing list