Skip to content

Commit

Permalink
[ISSUE apache#8725]clean DefaultMQPushConsumer after start fail
Browse files Browse the repository at this point in the history
  • Loading branch information
yuz10 authored Sep 21, 2024
1 parent 945e7ea commit 576f0b7
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1006,10 +1006,16 @@ public synchronized void start() throws MQClientException {
break;
}

this.updateTopicSubscribeInfoWhenSubscriptionChanged();
this.mQClientFactory.checkClientInBroker();
if (this.mQClientFactory.sendHeartbeatToAllBrokerWithLock()) {
this.mQClientFactory.rebalanceImmediately();
try {
this.updateTopicSubscribeInfoWhenSubscriptionChanged();
this.mQClientFactory.checkClientInBroker();
if (this.mQClientFactory.sendHeartbeatToAllBrokerWithLock()) {
this.mQClientFactory.rebalanceImmediately();
}
} catch (Exception e) {
log.warn("Start the consumer {} fail.", this.defaultMQPushConsumer.getConsumerGroup(), e);
shutdown();
throw e;
}
}

Expand Down

0 comments on commit 576f0b7

Please sign in to comment.