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 16:15:34 UTC

[GitHub] [rocketmq-spring] Jenyow opened a new issue #409: 使用 @RocketMQMessageListener 时,consumerGroup 值相同,selectorExpression 对应的标签值不同,只有后初始化的能消费消息

Jenyow opened a new issue #409:
URL: https://github.com/apache/rocketmq-spring/issues/409


   ## 版本
   2.2.1
   
   ## 问题描述
   1. 生产者向同一主题:myTopic 的 tag1、tag2 分别发送消息 
   2. 在消费者应用中分别使用 @RocketMQMessageListener(topic = "myTopic", consumerGroup = "${spring.application.name}", selectorExpression = "tag1") 、@RocketMQMessageListener(topic = "myTopic", consumerGroup = "${spring.application.name}", selectorExpression = "tag2") 类注解声明消费服务类
   3. 只有 1 个可以消费消息,另外一个永远消费不了消息
   
   ## 分析
   当 topic 、consumerGroup 相同,selectorExpression 不同,启动时后被初始化的 consumer 能消费信息;如果 consumerGroup 的值不同,则都可以消费信息;
   
   ## 疑问
   是否在同一应用中使用 @RocketMQMessageListener 声明多个消费服务类时, consumerGroup 的值是否一定要不一样?本来是想表达同一消费者组消费不同标签的消息。如果 consumerGroup  的值要求不一样,那意思就变成了,不同消费者组消费不同的标签了。这是否是一个 bug?
   
   


-- 
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-spring] vongosling commented on issue #409: Same group, different selectorExpression , dose it only the later could work?

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


    目前订阅关系是设计成这样的语义的


-- 
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-spring] Jenyow commented on issue #409: Same group, different selectorExpression , dose it only the later could work?

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


   @vongosling 你好。对于微服务来说,一般不是一个微服务就是一个消费者组吗?一个消费者组内根据不同的标签处理不同的逻辑,这个想法是否有问题?如果在同一个消费者类里根据标签写一堆判断,那代码就太丑陋了。这个是RocketMQ本身的原因限制了设计,还是 rocketmq-spring-boot-starter 的设计如此?后面是否考虑支持?


-- 
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-spring] vongosling closed issue #409: Same group, different selectorExpression , dose it only the later could work?

Posted by GitBox <gi...@apache.org>.
vongosling closed issue #409:
URL: https://github.com/apache/rocketmq-spring/issues/409


   


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