rabbitmq more consumers

rabbitmq more consumers deal

When rabbitmq have multiple consumers, it will send a polling message to the consumer (round-robin) received queue distribution method. Each message is sent only to subscribe to a list of consumers. This approach is very suitable for expansion, and it is specially designed for concurrent programs. If now the load is heavy, then simply create more consumers to spend to process messages

 

Cons: By default, if there are n consumers, then rabbitmq article will be distributed to the first message m m% n (way to take the remainder of) a consumer, rabbitmq regardless of whether the consumer and the consumer has confirmed (Basic.Ack ) message. If some consumers arduous, time to consume so much news, and some other consumers for some reason quickly assigned to deal with the end of the message, and then idle, this will cause a decline in the overall application throughput.

Solution: Use channel.basicQos rabbitmq limited maximum number of unacknowledged messages that can be held by the channel number of the consumer

Guess you like

Origin www.cnblogs.com/huanmin/p/11899527.html