RabbitMQ and relationship between channel and connection

The RabbitMQ Java client has the following concepts:

  • Connection – a connection to a RabbitMQ server instance
  • Channel – ???
  • Consumer thread pool – a pool of threads that consume messages off the RabbitMQ server queues
  • Queue – a structure that holds messages in FIFO order

I’m trying to understand the relationship, and more importantly, the associations between them.

  1. I’m still not quite sure what a Channel is, other than the fact that this is the structure that you publish and consume from, and that it is created from an open connection. If someone could explain to me what the “Channel” represents, it might help clear a few things up.
  2. What is the relationship between Channel and Queue? Can the same Channel be used to communicate to multiples Queues, or does it have to be 1:1?
  3. What is the relationship between Queue and the Consumer Pool? Can multiple Consumers be subscribed to the same Queue? Can multiple Queues be consumed by the same Consumer? Or is the relationship 1:1?

4 Answers
4

Leave a Comment