[rabbitmq-discuss] How to check is some bind present or no?

Matthias Radestock matthias at rabbitmq.com
Thu Sep 26 14:22:49 BST 2013


On 26/09/13 13:49, Haster wrote:
> Hi there!
> I look at all amqp methods and don't find any one that can give me
> information about is some binding present or not.
>
> For example, I want make binding only if it isn't present (I want delete all
> bindings that I created when my program stopped, but I don't want delete
> bind if they were present before).

So, just to be clear, you want to write a program that does the following:

1) for all bindings that need to be created, check whether the binding 
already exists

2) if the binding does not exist then create it and remember that

3) when the program finishes, delete all the bindings that were created 
in step (2)

The above would be fantastically racy. What if some other program added 
or deleted a binding between step 1 and 2?

An alternative, non-racy approach would be to make the bindings unique 
to the program by adding some a program invocation specific GUID to the 
binding arguments.

Matthias.


More information about the rabbitmq-discuss mailing list