0

I've implemented a typical Java Producer class which spreads messages to a Topic Durable Exchange.
Well, if I follow the tutorial, and send message through this exchange with a started consumer the consumer obey to the routing key keywords.

I bind my topic exchange to a queue with same routing key, and THEN I start a consumer with a non matching routing key, the message is delivered the same.

In practical, persistent queue seems to ignore the routing key topic laws.

Is the topic exchange function only with synchronous exchange communication?

Brian Kelly
  • 19,067
  • 4
  • 53
  • 55
Black.Jack
  • 1,878
  • 2
  • 22
  • 39
  • You should bind another queue with the non matching routing key, and THEN start your consumer on it. Aside from that, I don't understand your last question in this context. – superbob Oct 07 '14 at 07:48
  • Consumers will consume ALL messages delivered to the queue, the topic exchange will just route it to a queue. – Jan Vladimir Mostert Oct 07 '14 at 07:48
  • MMm...so if i want to persist topic sent messages to durable queues, every consumer bound to those queus, could read everything... even if also bound to a routing key\exchange, would read every message? So there is no chance to let routing ley rule to survive on a durable queue for the consumers? So topic exchange and routing key rules, are valid only for synchronous consumers? that's a pity! – Black.Jack Oct 07 '14 at 07:50
  • 2
    When you publish, you publish to an exchange, the routing key and topic or header only applies to the exchange, the exchange then uses that information to route it to a queue. When you consume, you consume from a queue, whatever came in last is consumed first, you can't filter what you consume, filtering needs to happen on the exchange. – Jan Vladimir Mostert Oct 07 '14 at 07:55
  • See my question, I was confused about it as well: https://stackoverflow.com/questions/25489301/only-consuming-messages-with-certain-headers-using-rabbitmq-and-springamqp – Jan Vladimir Mostert Oct 07 '14 at 07:57

0 Answers0