merlimat commented on a change in pull request #5491: Fix message deduplicate
issue while using external sequence id with batch produce
URL: https://github.com/apache/pulsar/pull/5491#discussion_r340898206
##########
File path:
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
##########
@@ -368,6 +372,19 @@ public void sendAsync(Message<T> message, SendCallback
callback) {
} else {
sequenceId = msgMetadataBuilder.getSequenceId();
}
+
+ if (sequenceId <= lastSequenceIdPushed) {
+ if (sequenceId <= lastSequenceIdPublished) {
+ callback.sendComplete(new PulsarClientException
+ .InvalidMessageException("Message is
definitely a duplicate"));
+ return;
+ } else {
+ callback.sendComplete(new PulsarClientException
+ .InvalidMessageException("Message is a
definitely a duplicate or not cannot be " +
+ "determined at this time"));
Review comment:
If we don't know whether is dup or not, then why are we triggering error
here?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services