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/07/11 16:23:32 UTC
[GitHub] [rocketmq-spring] crazylunsong opened a new issue #279: About consumer subscribe topic and group
crazylunsong opened a new issue #279:
URL: https://github.com/apache/rocketmq-spring/issues/279
你好:
我在FAQ中看到 【RocketMQ在设计时就不希望一个消费者同时处理多个类型的消息,因此同一个consumerGroup下的consumer职责应该是一样的,不要干不同的事情(即消费多个topic)。建议consumerGroup与topic一一对应。】这样一段话,意思就是说最好一个topic与一个group进行对应。但是为什么阿里云收费的ONS-client jar 中提供的api 却如下所示:
`
@Override
public void subscribe(String topic, String subExpression, MessageListener listener) {
if (null == topic) {
throw new ONSClientException("topic is null");
}
if (null == listener) {
throw new ONSClientException("listener is null");
}
this.subscribeTable.put(topic, listener);
super.subscribe(topic, subExpression);
}
`
ons-client的api中 的ConsumerImpl类中维护一个ConcurrentHashMap,key为topic,value为listener,也就是意味着一个consumer订阅多个topic,然后利用ConcurrentHashMap来回调到不同的listener,这是否与设计的初衷相违背?
期待你的回复! 万分感谢
----------------------------------------------------------------
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
[GitHub] [rocketmq-spring] RongtongJin commented on issue #279: About one consumer subscribe one or more topic and group relation
Posted by GitBox <gi...@apache.org>.
RongtongJin commented on issue #279:
URL: https://github.com/apache/rocketmq-spring/issues/279#issuecomment-659374146
The logic of ons-client may be different from RocketMQ-Spring, if you are using RocketMQ-Spring, please refer to RocketMQ-Spring wiki.
----------------------------------------------------------------
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
[GitHub] [rocketmq-spring] RongtongJin closed issue #279: About one consumer subscribe one or more topic and group relation
Posted by GitBox <gi...@apache.org>.
RongtongJin closed issue #279:
URL: https://github.com/apache/rocketmq-spring/issues/279
----------------------------------------------------------------
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