You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "poorbarcode (via GitHub)" <gi...@apache.org> on 2023/06/30 09:29:41 UTC

[GitHub] [pulsar] poorbarcode commented on a diff in pull request #20695: [fix] [client] Messages lost when consumer reconnect

poorbarcode commented on code in PR #20695:
URL: https://github.com/apache/pulsar/pull/20695#discussion_r1247660128


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:
##########
@@ -761,6 +761,11 @@ public void negativeAcknowledge(Message<?> message) {
 
     @Override
     public CompletableFuture<Void> connectionOpened(final ClientCnx cnx) {
+        // If success skip this subscribe request. If reconnection is required, whoever changes the state is
+        // responsible for reconnection. And the variable "duringConnect" will prevent the concurrent execution.
+        if (getState() == State.Ready) {
+            return CompletableFuture.completedFuture(null);
+        }

Review Comment:
   Fixed, thanks



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org