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 2018/01/11 20:09:36 UTC

[GitHub] rdhabalia commented on a change in pull request #1054: Populate message properties after building a message

rdhabalia commented on a change in pull request #1054: Populate message properties after building a message
URL: https://github.com/apache/incubator-pulsar/pull/1054#discussion_r161062602
 
 

 ##########
 File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageImpl.java
 ##########
 @@ -75,12 +81,8 @@ static MessageImpl create(MessageMetadata.Builder msgMetadataBuilder, ByteBuffer
         this.payload = Unpooled.copiedBuffer(payload);
 
         if (msgMetadata.getPropertiesCount() > 0) {
-            Map<String, String> properties = Maps.newTreeMap();
-            for (KeyValue entry : msgMetadata.getPropertiesList()) {
-                properties.put(entry.getKey(), entry.getValue());
-            }
-
-            this.properties = Collections.unmodifiableMap(properties);
+            this.properties = Collections.unmodifiableMap(msgMetadataBuilder.getPropertiesList().stream()
 
 Review comment:
   > I think this might also affect the replicator messages, , Maybe we could set properties to null and do a lazy population
   
   Make sense. fixed it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services