ShannonDing opened a new issue #3560:
URL: https://github.com/apache/rocketmq/issues/3560


   example/ordermessage/Consumer.java
   
   the ROLLBACK and COMMIT are deprecated, it should be removed from the 
examples.
   ``` @Override
               public ConsumeOrderlyStatus consumeMessage(List<MessageExt> 
msgs, ConsumeOrderlyContext context) {
                   context.setAutoCommit(true);
                   System.out.printf("%s Receive New Messages: %s %n", 
Thread.currentThread().getName(), msgs);
                   this.consumeTimes.incrementAndGet();
                   if ((this.consumeTimes.get() % 2) == 0) {
                       return ConsumeOrderlyStatus.SUCCESS;
                   } else if ((this.consumeTimes.get() % 3) == 0) {
                       return ConsumeOrderlyStatus.ROLLBACK;
                   } else if ((this.consumeTimes.get() % 4) == 0) {
                       return ConsumeOrderlyStatus.COMMIT;
                   } else if ((this.consumeTimes.get() % 5) == 0) {
                       context.setSuspendCurrentQueueTimeMillis(3000);
                       return 
ConsumeOrderlyStatus.SUSPEND_CURRENT_QUEUE_A_MOMENT;
                   }
   
                   return ConsumeOrderlyStatus.SUCCESS;
               }```


-- 
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: [email protected]

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


Reply via email to