[rabbitmq-discuss] Pattern - exclude

Emile Joubert emile at rabbitmq.com
Wed Feb 20 10:49:17 GMT 2013


Hi,

On 19/02/13 15:21, rabbit15 wrote:
> Hi. how to exclude something from pattern, f.e.
> I want to all publish starts with A but not ends with B
> 
> publish.A#..... ?

The wildcard characters * and # only match on whole words, so a pattern
like publish.A# is not valid. You can get around this restriction by
structuring routing keys to contain the first and last letters as
separate words, e.g.

publish.A.B.absorb
publish.C.D.candid

and to create bindings for all the patterns that start with A but don't
end with B:

publish.A.A.#
publish.A.C.#
publish.A.D.#
...
publish.A.Z.#
publish.A.0.#
...
publish.A.9.#

For more information see section 3.1.3.3 in the AMQP 0-9-1 specification:

http://www.rabbitmq.com/resources/specs/amqp0-9-1.pdf




-Emile










More information about the rabbitmq-discuss mailing list