Yelijah opened a new issue, #7842:
URL: https://github.com/apache/rocketmq/issues/7842

   ### Before Creating the Bug Report
   
   - [X] I found a bug, not just asking a question, which should be created in 
[GitHub Discussions](https://github.com/apache/rocketmq/discussions).
   
   - [X] I have searched the [GitHub 
Issues](https://github.com/apache/rocketmq/issues) and [GitHub 
Discussions](https://github.com/apache/rocketmq/discussions)  of this 
repository and believe that this is not a duplicate.
   
   - [X] I have confirmed that this bug belongs to the current repository, not 
other repositories of RocketMQ.
   
   
   ### Runtime platform environment
   
   macos 13.2.1 cpu:x86_64
   
   ### RocketMQ version
   
   server version: 5.1.4
   java client version: 5.0.5
   
   ### JDK Version
   
   openjdk version "1.8.0_265"
   
   ### Describe the Bug
   
   I want my consumer can retry infinitely, so I create a consumeGroup with 
retryTime as -1 which command like:
   ```
    ./bin/mqadmin updateSubGroup -n 127.0.0.1:9876 -c standalone -g 
fifoRetryInfinitelyConsumerGroup4 -o true -r -1        
   create subscription group to 192.168.250.2:10911 success.
   SubscriptionGroupConfig{groupName=fifoRetryInfinitelyConsumerGroup4, 
consumeEnable=true, consumeFromMinEnable=false, consumeBroadcastEnable=false, 
consumeMessageOrderly=true, retryQueueNums=1, retryMaxTimes=-1, 
groupRetryPolicy=GroupRetryPolicy{type=CUSTOMIZED, exponentialRetryPolicy=null, 
customizedRetryPolicy=null}, brokerId=0, whichBrokerWhenConsumeSlowly=1, 
notifyConsumerIdsChangedEnable=true, groupSysFlag=0, consumeTimeoutMinute=15, 
subscriptionDataSet=null, attributes={}}% 
   ```
   My consumer is like:
   ```
       @Test
       public void consumeFiFoMsgRetryInfinitely() throws Exception {
           consumeFifoMsg("fifoTopic", "fifoRetryInfinitelyConsumerGroup4", 
"消息5");
       }
   
       private void consumeFifoMsg(String topic, String consumerGroup, String 
retryMsg) throws ClientException, InterruptedException, IOException {
           PushConsumer consumer = provider.newPushConsumerBuilder()
                   .setConsumerGroup(consumerGroup)
                   .setClientConfiguration(clientConfiguration)
                   .setConsumptionThreadCount(2)  
                   .setSubscriptionExpressions(Collections.singletonMap(topic, 
new FilterExpression()))
                   .setMessageListener(new MessageListener() {
                       private final Random random = new Random();
                       @Override
                       public ConsumeResult consume(MessageView messageView) {
                           CommonUtils.log("receive msg:%s", messageView);
                           CommonUtils.sleep(random.nextInt(5));
                           if (retryMsg != null && 
ByteBufferUtils.toString(messageView.getBody()).startsWith(retryMsg)) {
                               CommonUtils.log("consume failed  msg:%s", 
messageView);
                               return ConsumeResult.FAILURE;
                           } else {
                               CommonUtils.log("consume success msg:%s", 
messageView);
                           }
                           return ConsumeResult.SUCCESS;
                       }}
                   ).build();
           Thread.sleep(3600 * 1000);
           consumer.close();
       }
   ```
   
   But the consumer can't receive any message at all. 
   
   
   ### Steps to Reproduce
   
   just like the describation
   
   ### What Did You Expect to See?
   
   I want my consumer can consume successfully , and retry infinitely when 
error happens.
   
   ### What Did You See Instead?
   
   My consumer can't receive msg at all.
   
   ### Additional Context
   
   _No response_


-- 
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-unsubscr...@rocketmq.apache.org.apache.org

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

Reply via email to