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


Reply via email to