[rabbitmq-discuss] RabbitMQ stomp-adapter behaviour

Matthias Radestock matthias at lshift.net
Tue Jun 9 06:09:17 BST 2009


Nicolas, Anders, and everybody else using the STOMP adapter,

Nicolas Echaniz wrote:

> it looks to me like non-STOMP extra-headers should not be required
> from the client in order to achieve what seems to be a rather common
> use case of a producer broadcasting to every subscribed consumer and
> not just to any  of them (round-robinish behaviour).

Choosing the right default behaviour - i.e. what happens when SEND and 
SUBSCRIBE specify nothing but the 'destination' header - is tricky.

Here are some key questions that we need to answer:

1) Should messages be routed to all subscribers or just one (round-robin)?

2) Should messages be queued when there are no subscribers?

3) When a client has multiple subscriptions to the same destination,
    should they receive one copy of a message or several?

Pretty much any combination of answers is plausible here and the STOMP 
spec does not prescribe any particular one.

So, recognising that with extra headers we can, in principle, get any 
behaviour we want, what should the *default* behaviour be?


The default behaviour of the current implementation of the RabbitMQ 
STOMP adapter

1) routes messages to one consumer (round-robin) - this can be changed 
to 'all' by specifying appropriate 'exchange' and 'routing_key' headers

2) does not queue messages when there are no subscribers - this can be 
changed by specifying an 'auto-delete = false' header (though that does 
require at least one SUBSCRIBE to start with)

3) sends only one copy of a message to a client in the event the client 
has more than one subscription for the same destination - this can be 
changed by specifying  appropriate 'exchange' and 'routing_key' headers


Should the default behaviour be different? And why?


Regards,

Matthias.




More information about the rabbitmq-discuss mailing list