Search code examples
rabbitmqspring-rabbit

RabbitMQ binding Java


i have started learning rabbitMQ and I am a bit confused in binding and routing key. So what I understood is -routing key is between exchange and queue and on consumer side we create declare exchange again and do channel.queue_bind() ... So where does the actual binding happens or how does the queue_bind() method works. Could anyone explains how it works or am i going wrong somewhere . Please let me know if any other details are needed. I am bit confused - I heard that there is some table maintained in exchange.


Solution

  • Take a look at the tutorials.

    They explain about the different exchange types and how queues are bound to exchanges.

    For example:

    • a queue bound to a fanout exchange needs no key in the binding - a message sent to a fanout exchange goest to all bound queues.
    • a queue bound to a direct change with routing key foo means that any message published to the exchange with that routing key will be routed to that queue.

    When you bind a queue to an exchange, it occurs on the broker; you can use the admin UI (when the plugin is enabled) to explore the queues/exchanges/bindings.