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 2021/09/06 08:35:44 UTC
[GitHub] [rocketmq-spring] leoxchang opened a new issue #387: when multiple instances in the same application,the consumer has the same instanceName,and the mq reblance error,the message delayed
leoxchang opened a new issue #387:
URL: https://github.com/apache/rocketmq-spring/issues/387
environment: rocketmq-spring-boot-starter2.2.0
when DefaultRocketMQListenerContainer class call initRocketMQPushConsumer method, the rocketmq consumer call setInstanceName method, through code we see the same nameserver has the same instancename.
DefaultRocketMQListenerContainer:
```
consumer.setInstanceName(RocketMQUtil.getInstanceName(nameServer));
```
RocketMQUtil:
```
public static String getInstanceName(String identify) {
char separator = '@';
StringBuilder instanceName = new StringBuilder();
instanceName.append(identify)
.append(separator).append(UtilAll.getPid());
return instanceName.toString();
}
```
when the ip is same ,the rocketmq clientid the same too.
but the rocketmq4.9.1,the code has changed:
```
public void changeInstanceNameToPID() {
if (this.instanceName.equals("DEFAULT")) {
this.instanceName = UtilAll.getPid() + "#" + System.nanoTime();
}
}
```
it's has add time to the instancename; so the rocketmq clientId can not be the same.
can we change the code like this?
--
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.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq-spring] leoxchang closed issue #387: when multiple instances in the same application,the consumer has the same instanceName,and the mq reblance error,the message delayed
Posted by GitBox <gi...@apache.org>.
leoxchang closed issue #387:
URL: https://github.com/apache/rocketmq-spring/issues/387
--
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.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq-spring] leoxchang commented on issue #387: when multiple instances in the same application,the consumer has the same instanceName,and the mq reblance error,the message delayed
Posted by GitBox <gi...@apache.org>.
leoxchang commented on issue #387:
URL: https://github.com/apache/rocketmq-spring/issues/387#issuecomment-913529885
ok,when 2.2.1 publish?
--
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.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq-spring] maixiaohai commented on issue #387: when multiple instances in the same application,the consumer has the same instanceName,and the mq reblance error,the message delayed
Posted by GitBox <gi...@apache.org>.
maixiaohai commented on issue #387:
URL: https://github.com/apache/rocketmq-spring/issues/387#issuecomment-913523478
@leoxchang Has been fixed at https://github.com/apache/rocketmq-spring/pull/342
--
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.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq-spring] maixiaohai edited a comment on issue #387: when multiple instances in the same application,the consumer has the same instanceName,and the mq reblance error,the message delayed
Posted by GitBox <gi...@apache.org>.
maixiaohai edited a comment on issue #387:
URL: https://github.com/apache/rocketmq-spring/issues/387#issuecomment-913523478
@leoxchang Has been fixed at https://github.com/apache/rocketmq-spring/pull/342
you can update your sdk version
--
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.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org