Demogorgon314 commented on code in PR #17209:
URL: https://github.com/apache/pulsar/pull/17209#discussion_r965602026


##########
pulsar-client-cpp/lib/ConsumerImpl.cc:
##########
@@ -170,23 +172,25 @@ void ConsumerImpl::connectionOpened(const 
ClientConnectionPtr& cnx) {
     cnx->registerConsumer(consumerId_, shared_from_this());
 
     Lock lockForMessageId(mutexForMessageId_);
-    Optional<MessageId> firstMessageInQueue = clearReceiveQueue();
-    if (subscriptionMode_ == Commands::SubscriptionModeNonDurable) {
-        // Update startMessageId so that we can discard messages after delivery
-        // restarts
-        startMessageId_ = firstMessageInQueue;
-    }
-    const auto startMessageId = startMessageId_;
+    // Update startMessageId so that we can discard messages after delivery 
restarts
+    startMessageId_ = clearReceiveQueue();
+    const auto subscribeMessageId = (subscriptionMode_ == 
Commands::SubscriptionModeNonDurable)
+                                        ? startMessageId_.get()
+                                        : Optional<MessageId>::empty();
     lockForMessageId.unlock();
 
     unAckedMessageTrackerPtr_->clear();
     batchAcknowledgementTracker_.clear();
 
     ClientImplPtr client = client_.lock();
     uint64_t requestId = client->newRequestId();
+    if (duringSeek_) {
+        ackGroupingTrackerPtr_->flushAndClean();
+    }

Review Comment:
   Addressed, but it looks like the order doesn't affect the final result. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to