There are two Rocket MQ clients, both of which belong to the same consumption group. How to set the message load balance consumption? It seems that one client has more consumption messages and the other has less, and the consumption is uneven.
How to set the message load balance consumption in RocketMQ with two client?
71 Views Asked by flower At
2
There are 2 best solutions below
0
On
DefaultMQPushConsumer consumer = new DefaultMQPushConsumer("CID_JODIE_1");
consumer.subscribe("TopicTest", "*");
// MessageModel.CLUSTERING means all consumers consume load-balancely
// MessageModel.BROADCASTING means every consumer instance will consume all messages
consumer.setMessageModel(MessageModel.CLUSTERING);
This link should clarify your question.