Shovel and routing key ... does it work?

570 views
Skip to first unread message

rabbi...@gmail.com

unread,
Dec 19, 2016, 2:27:48 AM12/19/16
to rabbitmq-users

I'm using RabbitMQ 3.6.2, Erlang 18.3 and I created a shovel from a remote exchange on another server with the routing key ".org.000000137." to a local exchange. In the remote exchange are coming messages, which routing key contains the ".org.000000137." text, but they don't arrive to the local exchange. If I change the routing key of the shovel to #, all messages arrive, and if I bind the local exchange to a queue with the routing key ".org.000000137.", I see in the queue only the messages that I'm interested in. But in this way I have to get all the messages from the remote exchange, which are really a lot, and therefore I would prefer to filter them out before taking them, but it seems not to work, or am I doing something wrong? Moreover if I have two shovels on the same remote exchange, the first one is working but the second one isn't, this means that I can have only one shovel on the same remote exchange?

To summarize:

  1. remote exchange with routing key # --> working (bound to a queue with routing key ".org.000000137." --> working)
  2. remote exchange with routing key ".org.000000137." --> not working
  3. 1st shovel on remote exchange with routing key # --> working
    2nd shovel on same remote exchange with routing key # --> not working

Any help would be appreciated, thanks

Michael Klishin

unread,
Dec 19, 2016, 4:45:40 AM12/19/16
to rabbitm...@googlegroups.com, rabbi...@gmail.com
Dots have special meaning in routing keys. Are you aware of that?

"#" likely works because it matches "one or more segments", which in some cases
translates to the entire routing key tail.

Don't use dots are "regular" dots (not segment separators) in routing keys with topic exchanges.

On 19 December 2016 at 10:27:52, rabbi...@gmail.com (rabbi...@gmail.com) wrote:
>
>
> I'm using RabbitMQ 3.6.2, Erlang 18.3 and I created a shovel from a remote
> exchange on another server with the routing key ".org.000000137." to a
> local exchange. In the remote exchange are coming messages, which routing
> key contains the ".org.000000137." text, but they don't arrive to the local
> exchange. If I change the routing key of the shovel to #, all messages
> arrive, and if I bind the local exchange to a queue with the routing key
> ".org.000000137.", I see in the queue only the messages that I'm interested
> in. But in this way I have to get all the messages from the remote
> exchange, which are really a lot, and therefore I would prefer to filter
> them out before taking them, but it seems not to work, or am I doing
> something wrong? Moreover if I have two shovels on the same remote
> exchange, the first one is working but the second one isn't, this means
> that I can have only one shovel on the same remote exchange?
>
> To summarize:
>
> 1. remote exchange with routing key # --> working (bound to a queue with
> routing key ".org.000000137." --> working)
> 2. remote exchange with routing key ".org.000000137." --> not working
> 3. 1st shovel on remote exchange with routing key # --> working
> 2nd shovel on same remote exchange with routing key # --> not working
>
> Any help would be appreciated, thanks
>
> --
> You received this message because you are subscribed to the Google Groups "rabbitmq-users"
> group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
> To post to this group, send an email to rabbitm...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

--
MK

Staff Software Engineer, Pivotal/RabbitMQ


rabbi...@gmail.com

unread,
Dec 19, 2016, 9:31:53 AM12/19/16
to rabbitmq-users, rabbi...@gmail.com
Thanks for the reply, so this means that if I have the following routing key "source.servername.org.000000137.client.0350525.timestamp.58375285" and I want to use a shovel on the "org.000000137", do I have to define the routing key like "#.org.000000137.#"?

Michael Klishin

unread,
Dec 19, 2016, 10:49:34 AM12/19/16
to rabbitm...@googlegroups.com, rabbi...@gmail.com, rabbi...@gmail.com
Seems so. IIRC hashes (“#”) match zero or more segments in any part of the key.

On 19 December 2016 at 17:31:57, rabbi...@gmail.com (rabbi...@gmail.com) wrote:
> Thanks for the reply, so this means that if I have the following routing
> key "source.servername.org.000000137.client.0350525.timestamp.58375285" and
> I want to use a shovel on the "org.000000137", do I have to define the
> routing key like "#.org.000000137.#"?
>
>
> On Monday, December 19, 2016 at 10:45:40 AM UTC+1, Michael Klishin wrote:
> >
> > Dots have special meaning in routing keys. Are you aware of that?
> >
> > "#" likely works because it matches "one or more segments", which in some
> > cases
> > translates to the entire routing key tail.
> >
> > Don't use dots are "regular" dots (not segment separators) in routing keys
> > with topic exchanges.
> >
> > On 19 December 2016 at 10:27:52, rabbi...@gmail.com <> (

rabbi...@gmail.com

unread,
Dec 20, 2016, 3:57:02 AM12/20/16
to rabbitmq-users, rabbi...@gmail.com, rabbi...@gmail.com
Hi, thanks for the reply I got it working but not with the two sharp symbols, what let me suppose, that you can have only one, or not?

1. #.org.000000137.# --> Doesn't work
2. *.*.org.000000137.# --> Work
Reply all
Reply to author
Forward
0 new messages