[rabbitmq-discuss] configuring an header exchange binding in rabbitmq.cfg

Matthew Sackman matthew at rabbitmq.com
Thu Nov 10 17:42:34 GMT 2011


Hi Tom,

On Thu, Nov 10, 2011 at 05:31:26PM +0000, Matthew Sackman wrote:
> Which version of RabbitMQ are you using? "rabbitmq.cfg" isn't a file
> name that I recognise - I think you mean "rabbitmq.config", and indeed
> that's the file name that the shovel README talks about:
> http://hg.rabbitmq.com/rabbitmq-shovel/file/b9f4e6dc4fa3/README
> 
> The bind will look something like:
> 
> {'queue.bind',
>        [{exchange, <<"my_exchange">>},
>         {queue,    <<"my_queue">>},
>         {arguments, [{"x-match",         longstr, "any"},
>                      {"headerName",      longstr, "headerValue"},
>                      {"otherHeaderName", longstr, "otherHeaderValue"}]}]}
> 
> I think.

That will work if the binding is being created on an endpoint which is
not a "direct" connection. Otherwise, you need to ensure the keys and
values are binaries. There is a bug open for this - it's a mistake in
the erlang client which the shovel uses, but alas it's not been fixed
yet. So if in doubt, use something like:

{'queue.bind',
       [{exchange, <<"my_exchange">>},
        {queue,    <<"my_queue">>},
        {arguments, [{<<"x-match">>,         longstr, <<"any">>},
                     {<<"headerName">>,      longstr, <<"headerValue">>},
                     {<<"otherHeaderName">>, longstr, <<"otherHeaderValue">>}]}]}


Matthew


More information about the rabbitmq-discuss mailing list