未验证 提交 36e6687d 编写于 作者: H Heng Du 提交者: GitHub

Merge pull request #3120 from lwclover/develop

[ISSUE #3066]producing a ghost consumer at frequently start and stop consumers in one process
......@@ -863,7 +863,7 @@ public class MQClientInstance {
}
}
public boolean registerConsumer(final String group, final MQConsumerInner consumer) {
public synchronized boolean registerConsumer(final String group, final MQConsumerInner consumer) {
if (null == group || null == consumer) {
return false;
}
......@@ -877,9 +877,9 @@ public class MQClientInstance {
return true;
}
public void unregisterConsumer(final String group) {
public synchronized void unregisterConsumer(final String group) {
this.consumerTable.remove(group);
this.unregisterClientWithLock(null, group);
this.unregisterClient(null, group);
}
private void unregisterClientWithLock(final String producerGroup, final String consumerGroup) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册