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


   in your example, with you own define MessageQueueListener, may be 
your。consumer will not get any MessageQueue for consume。
   
   just some tips for help,you can ref https://www.jianshu.com/p/fc6e4cfe39cb
   
   ```
   try {
               MessageQueueListener mql = new MessageQueueListener() {
                   @Override
                   public void messageQueueChanged(String topic, 
Set<MessageQueue> mqAll, Set<MessageQueue> mqDivided) {
                       System.out.printf("=============messageQueueChanged 
topic:%s q:%s %n",topic,JSON.toJSONString(mqDivided));
   
                       System.out.printf("queue assigned to consumer[%s] are: 
%n", litePullConsumer.getInstanceName());
                       for(MessageQueue q: mqDivided){
                           System.out.printf("%d ",q.getQueueId());
                       }
                       System.out.printf("%nmqAll:%s 
%n",JSON.toJSONString(mqAll));
                       //litePullConsumer.assign(mqDivided);
                   }
               };
               //当设置了messageQueueListener后,可能再也收不到消息了。。
               //不设置messageQueueListener,可以正常收消息
               //litePullConsumer.setMessageQueueListener(mql);
   }
   ```


----------------------------------------------------------------
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