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 2020/12/10 12:38:22 UTC

[GitHub] [rocketmq-spring] RongtongJin commented on issue #305: Support change consumer rebalance strategy

RongtongJin commented on issue #305:
URL: https://github.com/apache/rocketmq-spring/issues/305#issuecomment-742495496


   You can do it this way
   ```java
   /**
    * StringConsumer
    */
   @Service
   @RocketMQMessageListener(topic = "${demo.rocketmq.topic}", consumerGroup = "string_consumer", selectorExpression = "${demo.rocketmq.tag}")
   public class StringConsumer implements RocketMQListener<String> , RocketMQPushConsumerLifecycleListener {
       @Override
       public void onMessage(String message) {
           System.out.printf("------- StringConsumer received: %s \n", message);
       }
   
       public void prepareStart(DefaultMQPushConsumer consumer) {
           consumer.setAllocateMessageQueueStrategy(new AllocateMessageQueueXXXXX());
       }
   }
   ```


----------------------------------------------------------------
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:
users@infra.apache.org