RabbitMQ: fast producer and slow consumer

前端 未结 5 1434
余生分开走
余生分开走 2021-02-01 06:31

I have an application that uses RabbitMQ as the message queue to send/receive message between two components: sender and receiver. The sender sends message in a very fast way. T

5条回答
  •  -上瘾入骨i
    2021-02-01 06:49

    You have lot of ways to increase your performance.

    1. You can create a worker queue with more producers, in this way you create an simple load-balance system. don't use exchange---> queue but only queue. Read this post RabbitMQ Non-Round Robin Dispatching

    2. When you get a message you can create a poolthread for insert the data on your database, but in this case you have to manage the failure.

    But I think the principal problem is the database and not RabbitMQ. With a good tuning, multi-threading and worker queue you can have a scalable and fast solution.

    Let me know

提交回复
热议问题