mirror of
https://github.com/apache/rocketmq.git
synced 2026-09-19 02:23:24 +08:00
* [ISSUE #8725]clean DefaultMQPushConsumer after start fail * clean DefaultLitePullConsumerImpl after start fail
This commit is contained in:
+6
-1
@@ -307,7 +307,12 @@ public class DefaultLitePullConsumerImpl implements MQConsumerInner {
|
||||
|
||||
log.info("the consumer [{}] start OK", this.defaultLitePullConsumer.getConsumerGroup());
|
||||
|
||||
operateAfterRunning();
|
||||
try {
|
||||
operateAfterRunning();
|
||||
} catch (Exception e) {
|
||||
shutdown();
|
||||
throw e;
|
||||
}
|
||||
|
||||
break;
|
||||
case RUNNING:
|
||||
|
||||
+10
-4
@@ -1006,10 +1006,16 @@ public class DefaultMQPushConsumerImpl implements MQConsumerInner {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user