From c91274a73a9b20ef6edb89ef94af573f0103afdb Mon Sep 17 00:00:00 2001 From: keranbingaa <397294722@qq.com> Date: Mon, 12 Sep 2022 10:04:37 +0800 Subject: [PATCH] for issue #65:persist offset when unsub --- .../java/com/webank/defibus/consumer/DeFiBusPushConsumer.java | 1 + 1 file changed, 1 insertion(+) diff --git a/defibus-client/src/main/java/com/webank/defibus/consumer/DeFiBusPushConsumer.java b/defibus-client/src/main/java/com/webank/defibus/consumer/DeFiBusPushConsumer.java index 4130d66..ac266f5 100644 --- a/defibus-client/src/main/java/com/webank/defibus/consumer/DeFiBusPushConsumer.java +++ b/defibus-client/src/main/java/com/webank/defibus/consumer/DeFiBusPushConsumer.java @@ -169,6 +169,7 @@ public void unsubscribe(String topic, boolean isNeedSendHeartbeat) { ProcessQueue pq = entry.getValue(); if (messageQueue.getTopic().equals(topic)) { pq.setDropped(true); + this.getDefaultMQPushConsumer().getDefaultMQPushConsumerImpl().getOffsetStore().persist(messageQueue); } } this.defaultMQPushConsumer.unsubscribe(topic);