lebron374 edited a comment on issue #2127:
URL: https://github.com/apache/rocketmq/issues/2127#issuecomment-653702287


   > > > litePullConsumer
   > > 
   > > 
   > > litePullConsumer.start() should after 
litePullConsumer.setMessageQueueListener(mql)???
   > 
   > Both not work.
   > Below is the workaround:
   > `consumer.subscribe(topic, "*"); consumer.start(); consumer.poll(); 
consumer.setMessageQueueListener(mql);`
   
   the default MessageQueueListenerImpl like this,can you fund some difference
   
   ```
   
org.apache.rocketmq.client.impl.consumer.DefaultLitePullConsumerImpl.MessageQueueListenerImpl
   
       class MessageQueueListenerImpl implements MessageQueueListener {
           @Override
           public void messageQueueChanged(String topic, Set<MessageQueue> 
mqAll, Set<MessageQueue> mqDivided) {
               MessageModel messageModel = 
defaultLitePullConsumer.getMessageModel();
               switch (messageModel) {
                   case BROADCASTING:
                       updateAssignedMessageQueue(topic, mqAll);
                       updatePullTask(topic, mqAll);
                       break;
                   case CLUSTERING:
                       updateAssignedMessageQueue(topic, mqDivided);
                       updatePullTask(topic, mqDivided);
                       break;
                   default:
                       break;
               }
           }
       }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to