rocketmq-spring icon indicating copy to clipboard operation
rocketmq-spring copied to clipboard

RocketMQMessageListener nameServer not work

Open henrypoter opened this issue 6 years ago • 7 comments

  1. Please describe the issue you observed:

I have a webapp, there are two consumers which connect to two rocketmq clusters. Each of the consumer have different nameserver, topics and consumer group names. As belows: `@RocketMQMessageListener( nameServer = "${uat.rocketmq.nameServer}", topic = "uat-topic", consumerGroup = "demo-consumer-group-uat")

@RocketMQMessageListener( nameServer = "${dev.rocketmq.nameServer}", topic = "dev-topic", consumerGroup = "demo-consumer-group-dev")`

I have a global config: rocketmq.name-server=10.2.3.4:9876

The consumers will always subscribe to the global configed nameserver.

This issue is not the same with https://github.com/apache/rocketmq-spring/issues/254 But I have a workaround by setting the instanceName of consumers.

henrypoter avatar Jun 15 '20 07:06 henrypoter

It is indeed a bug. If we do not set different instanceName for consumer in same process, the same MQClientInstance will be used by the consumer, causing the nameserver address to be overwritten.  If you have any workaround, it is welcomed to submit a pull request to solve it.

RongtongJin avatar Jun 15 '20 08:06 RongtongJin

Has anyone fixed this bug? @RongtongJin

zongtanghu avatar Jun 24 '20 03:06 zongtanghu

Has anyone fixed this bug? @RongtongJin

Not yet, PR is welcomed to fix this issue.

RongtongJin avatar Jun 24 '20 07:06 RongtongJin

Can you help to fix this issue and put forward a pr? @zhangjidi2016

zongtanghu avatar Jun 24 '20 08:06 zongtanghu

OK,this issue can assign to me.

zhangjidi2016 avatar Jun 24 '20 10:06 zhangjidi2016

It's yours.And this issue may be difficult to reproducer in test enviroment, you can ask @RongtongJin for some of its details. @zhangjidi2016

zongtanghu avatar Jun 24 '20 14:06 zongtanghu

Fix it.

RongtongJin avatar Oct 28 '20 01:10 RongtongJin