[rabbitmq-discuss] Negative policy for HA queue name matching

Laing, Michael P. Michael.Laing at nytimes.com
Thu Nov 29 01:02:25 GMT 2012


I thought I would post this because I found it useful in our case – and it is not particularly intuitive.

Most of our queues are HA, but apps create temporary queues which might as well be local, and sometimes we create local queues too.

Here is the pattern for a policy that will match all queue names EXCEPT those which start with 'amq.' or 'local.'

^(?!local\.|amq\.).*$

With this, temporary queues will not be HA, nor will queues we create that are prefixed with 'local.'.

In case you are wondering that regex uses a compound negative lookahead… inefficient but that doesn't matter in our case, as we don't create lots of temporary or local queues.

This makes our transition to 3.0 a little easier, as we don't have to rename queues, and I hope it helps someone else too.

Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20121128/bc790913/attachment.htm>


More information about the rabbitmq-discuss mailing list