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 2020/08/01 08:11:56 UTC

[GitHub] [pulsar] rdhabalia commented on a change in pull request #7705: [pulsar-client] Remove UUID generation on sending message

rdhabalia commented on a change in pull request #7705:
URL: https://github.com/apache/pulsar/pull/7705#discussion_r463937795



##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
##########
@@ -103,7 +102,15 @@
     private final BatchMessageContainerBase batchMessageContainer;
     private CompletableFuture<MessageId> lastSendFuture = CompletableFuture.completedFuture(null);
 
-    // Globally unique producer name
+    /**
+     * Globally unique producer name generated by server. It should be the same as {@link #producerName} unless user
+     * configures {@link ProducerConfigurationData::setProducerName}.

Review comment:
       I have changed it but I don't think `user_producer_id` + `sequence_id` can create UUID because `user_producer_id` can be reused by other producer later on and `sequence_id` can start with `0` again and it will create a duplicate combination which will not be unique across messages on the topic and that can be issue for message chunking.
   eg:
   Producer P1 gives name `userProducer1` and publish message with sequenceId=`0`. Now that process died and another process created producer with similar name `userProducer1` and started message with sequenceId=`0` in which case UUID will not be unique.
   Therefore, using `serverProducerName` always gives a guarantee for unique producer-id and UUID. Adding new string `serverProducerId` will not create any overhead as well. So, can you please let me know your thought on it.




----------------------------------------------------------------
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:
users@infra.apache.org