2
votes

I am trying to use BasicGet to retrieve only messages that match the Channel's Exchange/Queue/RoutingKey combination.

An example of our routing keys is

Development:STACK_1_WEBSERVER_V2:1:2.9.0.0

The trouble I am having is that the Routing Key is being completely ignored and all messages no matter what the specified routing key are available via BasicGet.

I am using a Direct exchange. I though Direct was enough, I do not need the ability to Wildcard the routing keys that you get with Topic exchanges.

Is a Direct Exchange and Routing Key solution supposed to work with BasicGet?

Thanks

1

1 Answers

4
votes

A direct exchange and routing keys is enough although your getter is pulling from a queue which has messages with multiple routing keys. You will need to setup separate queues for each getter that will want it's own group of messages.

This isn't a difference between basic.get and basic.consume in AMQP.

The exchange type and routing key doesn't matter at the time you are pulling the message from the queue, the message has already been routed to a queue.