equanz commented on a change in pull request #10279:
URL: https://github.com/apache/pulsar/pull/10279#discussion_r700910200



##########
File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/PartitionedProducerImpl.java
##########
@@ -113,25 +126,22 @@ private MessageRouter getMessageRouter() {
 
     @Override
     public String getProducerName() {
-        return producers.get(0).getProducerName();
+        return producers.get(firstPartitionIndex).getProducerName();

Review comment:
       > shouldn't be the same producerName for all the producers ?
   
   In my understanding, currently producerName is calculated for each partition 
if doesn't set it at ProducerBuilder.
   
   
https://github.com/apache/pulsar/blob/fe4cd09c297f7ab2a892a6c81bb0998e7ee737f2/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java#L1110-L1111
   
https://github.com/apache/pulsar/blob/fe4cd09c297f7ab2a892a6c81bb0998e7ee737f2/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java#L1364-L1366
   
   > why not computing the name in the constructor and cache it ?
   
   I'll add the behavior that compute and cache producerName to below. 
   
https://github.com/apache/pulsar/blob/fe4cd09c297f7ab2a892a6c81bb0998e7ee737f2/pulsar-client/src/main/java/org/apache/pulsar/client/impl/PartitionedProducerImpl.java#L134-L160




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