You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/12/13 08:21:36 UTC

[GitHub] [pulsar] HQebupt edited a comment on issue #13178: Producer publishMessage uses a wrong sequence id?

HQebupt edited a comment on issue #13178:
URL: https://github.com/apache/pulsar/issues/13178#issuecomment-992214786


   @leizhiyuan I believe it is unnessarry since the metadata of send command is broken. You can never know which sequeence id is broken. And Pulsar Client handle the send error in this way as follows. The ServerError.MetadataError cause the producer reconnection. 
   So I believe we can close this issue. 
   ```java
   // ClientCnx.java
   @Override
       protected void handleSendError(CommandSendError sendError) {
           log.warn("{} Received send error from server: {} : {}", ctx.channel(), sendError.getError(),
                   sendError.getMessage());
   
           long producerId = sendError.getProducerId();
           long sequenceId = sendError.getSequenceId();
   
           switch (sendError.getError()) {
           case ChecksumError:
               producers.get(producerId).recoverChecksumError(this, sequenceId);
               break;
   
           case TopicTerminatedError:
               producers.get(producerId).terminated(this);
               break;
           case NotAllowedError:
               producers.get(producerId).recoverNotAllowedError(sequenceId);
               break;
   
           default:
               // By default, for transient error, let the reconnection logic
               // to take place and re-establish the produce again
               ctx.close();
           }
       }
   
   ```


-- 
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