Closed chwii closed 4 years ago
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.
@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?
@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.
I was able to do so with rocketmq-client like below
Is this possible with rocketmq-spring-boot-starter? Or is it ok if I stick to rocketmq-client in my Spring Boot project