RabbitMQ-Is it a good practice to create multiple consumers for a single queue in one application process

Viewed 2939

I just work with an new project backed by RabbitMQ, and there are multiple consumer instances created listening to the same queue when the application starts. Howerver they shares the same connections with different channels.

The messages from the queue are massive(millions messages for one single producing behavior ) so I guess the very first code author is trying to do something to make consuming faster.

I am trying to find some posts discussing on this but I can't find a very certain answer.

What I get so far is:

  1. Each channel will have a separate dispatch thread
  2. The operation commands on the same channel is serialized even though they are called in multiple thread

So

  1. creating multiple consumers thus multiple channels will have multiple dispatch threads, but I don't think it provided a better performance to message dispatching since the dispatch should far from enough with one single thread.

  2. The operation of ack will can be paralized in different channels, I am not quite sure this will give any better performances.

Since more channels consume more system resources I wonder is this practice good?

1 Answers
Related