[rabbitmq-discuss] Possibilities of RabbitMq pluggin

Michael Klishin mklishin at gopivotal.com
Thu Mar 27 11:19:26 GMT 2014


On 27 March 2014 at 15:06:42, De Jaeghere, Patrice PDJ (pdejaeghere at beckman.com) wrote:
> >
> 1) We need an atomic function that verifies if an echange exists,  
> creates it if it doesn’t exist but return false if it exists. Can  
> we implement this function with a RabbitMQ pluggin in erlang  
> and can we call this function with the dotnet driver (or extension?)  

You don’t need a plugin to do this. Create a temporary channel (model in .NET
client) and use ExchangeDeclarePassive. If it raises an exception (RabbitMQ.Exceptions.OperationInterruptedException), the exchange does not exist,
otherwise it does.
Then use Model#ExchangeDeclare to declare it (if needed).

This is not atomic in the sense that it requires multiple requests but as long
as different apps/clients agree on exchange attributes, it is completely safe
to re-declare an exchange or use the above technique. 

> 2) Other need: When a queue has not anymore consumers , and if this  
> queue is not persistent , is-it possible to develop a RabbitMQ  
> pluggin which moves all messages of this queue in a dead-letter  
> queue just before its deletion.

This currently requires a plugin. If messages were dead-lettered
when a queue is deleted (e.g. because it was auto-deleted and the last consumer
disconnects), it would also be possible without a plugin, but that’s not the case.
--  
MK  

Software Engineer, Pivotal/RabbitMQ


More information about the rabbitmq-discuss mailing list