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 2021/11/30 12:56:53 UTC

[GitHub] [rocketmq] ShannonDing opened a new issue #3560: Remove deprecated status in the orderly consumer examples.

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: dev-unsubscribe@rocketmq.apache.org

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



[GitHub] [rocketmq] NAMANIND commented on issue #3560: Remove deprecated status in the orderly consumer examples.

Posted by GitBox <gi...@apache.org>.
NAMANIND commented on issue #3560:
URL: https://github.com/apache/rocketmq/issues/3560#issuecomment-982623869


   @ShannonDing  can you please elaborate more?
   Should I have to remove ifelse statement of 
    `rollback` and `commit` ? If yes please assign this work to me.


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



[GitHub] [rocketmq] Git-Yang commented on issue #3560: Remove deprecated status in the orderly consumer examples.

Posted by GitBox <gi...@apache.org>.
Git-Yang commented on issue #3560:
URL: https://github.com/apache/rocketmq/issues/3560#issuecomment-985206658


   Merged


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



[GitHub] [rocketmq] Git-Yang closed issue #3560: Remove deprecated status in the orderly consumer examples.

Posted by GitBox <gi...@apache.org>.
Git-Yang closed issue #3560:
URL: https://github.com/apache/rocketmq/issues/3560


   


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



[GitHub] [rocketmq] clbigdata commented on issue #3560: Remove deprecated status in the orderly consumer examples.

Posted by GitBox <gi...@apache.org>.
clbigdata commented on issue #3560:
URL: https://github.com/apache/rocketmq/issues/3560#issuecomment-982709316


   please assign this work to me.


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



[GitHub] [rocketmq] ShannonDing commented on issue #3560: Remove deprecated status in the orderly consumer examples.

Posted by GitBox <gi...@apache.org>.
ShannonDing commented on issue #3560:
URL: https://github.com/apache/rocketmq/issues/3560#issuecomment-983207298


   > 
   yes, right. according to the definition below, the enum ROLLBACK and COMMIT are deprecated.
   let's clear up the recommend in the examples first.
   just remove the remove if-else statements....
   ```
   package org.apache.rocketmq.client.consumer.listener;
   
   public enum ConsumeOrderlyStatus {
       /**
        * Success consumption
        */
       SUCCESS,
       /**
        * Rollback consumption(only for binlog consumption)
        */
       @Deprecated
       ROLLBACK,
       /**
        * Commit offset(only for binlog consumption)
        */
       @Deprecated
       COMMIT,
       /**
        * Suspend current queue a moment
        */
       SUSPEND_CURRENT_QUEUE_A_MOMENT;
   }
   ```


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