[rabbitmq-discuss] How to set fast expiration for messages or destinations (STOMP 1.0)?

Simon MacMullen simon at rabbitmq.com
Mon May 28 21:52:55 BST 2012


On 28/05/2012 7:50PM, Michael Justin wrote:
> For a simple replacement of the STOMP 1.1 heartbeat feature, I would
> like to use fast-expiring messages or destinations which do not keep
> messages for a long time. Is this possible with the RabbitMQ
> configuration file, so that it will also have an effect on STOMP messages?

You can publish to a pre-declared queue with /amq/queue/<name>, having 
declared the queue with a low message ttl previously over AMQP or via 
the management interface.

But if you're going to do that, you could declare an exchange that is 
not being used for anything else, and publish to that: then your 
messages will be never even hit a queue. If you don't want to have to 
declare an exchange in advance, you could use one of the built-in ones:

/exchange/amq.fanout
/exchange/amq.direct
/exchange/amq.headers

(assuming you're not using these for anything else, which you're 
presumably not)

You should probably avoid using amq.topic since that's used for 
/topic/<name> destinations in STOMP.

Cheers, Simon


More information about the rabbitmq-discuss mailing list