mirror of
https://github.com/apache/rocketmq.git
synced 2026-09-24 16:04:00 +08:00
Merge pull request #3120 from lwclover/develop
[ISSUE #3066]producing a ghost consumer at frequently start and stop consumers in one process
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user