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/01/15 08:56:11 UTC

[GitHub] [rocketmq-spring] chwii opened a new issue #224: Is it possible to create consumer that subscribe to certain topic on the fly?

chwii opened a new issue #224: Is it possible to create consumer that subscribe to certain topic on the fly?
URL: https://github.com/apache/rocketmq-spring/issues/224
 
 
   I was able to do so with rocketmq-client like below
   ```java
   public DefaultMQPushConsumer create(Object...args){
   // basic setup omitted
       defaultMQPushConsumer.subscribe(certainTopic, "*");
       defaultMQPushConsumer.registerMessageListener(new MessageListenerConcurrently(){
           //custom consumeMessage() logic
       });
   }
   ```
   Is this possible with rocketmq-spring-boot-starter?
   Or is it ok if I stick to rocketmq-client in my Spring Boot project

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


With regards,
Apache Git Services

[GitHub] [rocketmq-spring] RongtongJin closed issue #224: Is it possible to create consumer that subscribe to certain topic on the fly?

Posted by GitBox <gi...@apache.org>.
RongtongJin closed issue #224: Is it possible to create consumer that subscribe to certain topic on the fly?
URL: https://github.com/apache/rocketmq-spring/issues/224
 
 
   

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


With regards,
Apache Git Services

[GitHub] [rocketmq-spring] RongtongJin commented on issue #224: Is it possible to create consumer that subscribe to certain topic on the fly?

Posted by GitBox <gi...@apache.org>.
RongtongJin commented on issue #224: Is it possible to create consumer that subscribe to certain topic on the fly?
URL: https://github.com/apache/rocketmq-spring/issues/224#issuecomment-576199250
 
 
   @chwii It‘s a little complicated if you need to create a consumer at runtime using rocketmq-spring. It is recommended that you still use rocketmq-client in your spring boot project.

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


With regards,
Apache Git Services

[GitHub] [rocketmq-spring] xiangwangcheng commented on issue #224: Is it possible to create consumer that subscribe to certain topic on the fly?

Posted by GitBox <gi...@apache.org>.
xiangwangcheng commented on issue #224: Is it possible to create consumer that subscribe to certain topic on the fly?
URL: https://github.com/apache/rocketmq-spring/issues/224#issuecomment-575961040
 
 
   I'm not sure what do you mean of 'on the fly', but you can create a consumer subscribing to a certain topic like below.
   ![image](https://user-images.githubusercontent.com/8049014/72673850-8b0da500-3aaa-11ea-8193-4b2ebdc2d0c6.png)
   

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


With regards,
Apache Git Services

[GitHub] [rocketmq-spring] chwii commented on issue #224: Is it possible to create consumer that subscribe to certain topic on the fly?

Posted by GitBox <gi...@apache.org>.
chwii commented on issue #224: Is it possible to create consumer that subscribe to certain topic on the fly?
URL: https://github.com/apache/rocketmq-spring/issues/224#issuecomment-575964021
 
 
   @xiangwangcheng
   Of course I read the consumer demo before I open this issue, unfortunately they didn't meet my needs because I have no idea what topic I should subscribe to in coding phase(actually I do but topics can be added dynamically).
   What I want to implement here is to create consumer and register listener(different `onMessage` logic maybe) on method invocation instead of hard-coded classes like the demo.
   With rocketmq-client I can just wrap the creation logic like my snippet and can call `create(args)`  in case of topic addition. Dose this make sense to you?

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


With regards,
Apache Git Services