You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/06/16 13:15:37 UTC

[GitHub] [rocketmq-spring] Sdky opened a new issue, #465: 消息无法被消费

Sdky opened a new issue, #465:
URL: https://github.com/apache/rocketmq-spring/issues/465

   队列配置
   主题名 string-topic2,写队列数量、读队列数量 都是 128,perm = 6
   
   生产者
   ```java
   // Send a batch of strings
   for (int q = 0; q < 4000; q++) {
       List<Message> msgs = new ArrayList<Message>();
       for (int i = 0; i < 10; i++) {
           int msgIndex = q * 10 + i;
           String msg = String.format("Hello RocketMQ Batch Msg#%d to queue: %d", msgIndex, q);
           msgs.add(MessageBuilder.withPayload(msg).
                   setHeader(RocketMQHeaders.KEYS, "KEY_" + msgIndex).build());
       }
       SendResult sr = rocketMQTemplate.syncSendOrderly(springTopic, msgs, q + "", 60000);
       System.out.println("--- Batch messages orderly to queue :" + sr.getMessageQueue().getQueueId() + " send result :" + sr);
   }
   ```
   
   消费者
   ```java
   @Service
   @RocketMQMessageListener(topic = "string-topic2", consumerGroup = "string_consumer", consumeMode = ConsumeMode.ORDERLY, consumeThreadNumber = 128, consumeThreadMax = 128)
   public class StringConsumer implements RocketMQListener<String> {
       @Override
       public void onMessage(String message) {
           System.out.printf("[%s]------- StringConsumer received: %s \n", Thread.currentThread().getName(), message);
       }
   }
   ```
   
   发现只能消费前面 64 个队列的消息,即使启动了多个消费者,后面的消息一直都无法被消费。
   ![image](https://user-images.githubusercontent.com/29597396/174076881-0b423366-e24d-4057-bdb6-29677cb2aaa2.png)
   
   请问是我的代码哪里有问题吗?


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

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-spring] idler41 commented on issue #465: 消息无法被消费

Posted by "idler41 (via GitHub)" <gi...@apache.org>.
idler41 commented on issue #465:
URL: https://github.com/apache/rocketmq-spring/issues/465#issuecomment-1463223811

   > 兄弟你是怎么解决的,能分享一下吗
   
   同样有这个问题,debug发现一个消费者启动时获取到两个cid(DefaultLitePullConsumer与DefaultMQPushConsumer),两个consumer共享了配置(rocketmq.consumer.group,rocketmq.consumer.group.topic)。导致只分配到一半的queue。解决方法是不实例化DefaultLitePullConsumer即可。    
   
   ```
       @Bean(CONSUMER_BEAN_NAME)
       @ConditionalOnMissingBean(DefaultLitePullConsumer.class)
       @ConditionalOnProperty(prefix = "rocketmq", value = {"name-server", "consumer.group", "consumer.topic"})
       public DefaultLitePullConsumer defaultLitePullConsumer(RocketMQProperties rocketMQProperties)
   ```


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

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-spring] chaoshui66 commented on issue #465: 消息无法被消费

Posted by GitBox <gi...@apache.org>.
chaoshui66 commented on issue #465:
URL: https://github.com/apache/rocketmq-spring/issues/465#issuecomment-1306550016

   兄弟你是怎么解决的,能分享一下吗


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

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-spring] idler41 commented on issue #465: 消息无法被消费

Posted by "idler41 (via GitHub)" <gi...@apache.org>.
idler41 commented on issue #465:
URL: https://github.com/apache/rocketmq-spring/issues/465#issuecomment-1463190715

   同样有这个问题,debug发现一个消费者启动时获取到两个cid,导致只分配到一半的queue。用rocketmq-client原生方式正常


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

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-spring] Sdky closed issue #465: 消息无法被消费

Posted by GitBox <gi...@apache.org>.
Sdky closed issue #465: 消息无法被消费
URL: https://github.com/apache/rocketmq-spring/issues/465


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

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org