<div>I'm starting to write a prototype with RabbitMQ but I've some problem to understand the concept of "routing key", below there's an excerpt of the producer:</div><div><br></div><div> String exchangeName = "myExchange";</div>
<div> channel.exchangeDeclare(exchangeName, "direct");</div><div> String queueName = "myQueue";</div><div> channel.queueDeclare(queueName);</div><div> String routingKey = "testRoute";</div>
<div> channel.queueBind(queueName, exchangeName, routingKey);</div><div><br></div><div>the consumer's code is the the same except it defines a routingKey = "xyz"</div><div><br></div><div>Why does the consumer gets the messages even if the routing key that it defines is different from the one defined by the producer?</div>
<div><br></div><div>Is there a document that describes the routing algorithm based on the routing key?</div><div><br></div><div>Thanks and regards,</div><div>Alex</div>