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 2022/03/02 09:03:02 UTC

[GitHub] [pulsar] tjiuming commented on issue #14492: [pulsar-client] Support Message.getProperties() modification.

tjiuming commented on issue #14492:
URL: https://github.com/apache/pulsar/issues/14492#issuecomment-1056621757


   do can do it like this: 
   ```
           MessageImpl<?> msg = null;
           if (message instanceof MessageImpl<?>) {
               msg = (MessageImpl<?>) message;
   
           } else if (message instanceof TopicMessageImpl<?>) {
               msg = (MessageImpl<?>) ((TopicMessageImpl<?>) message).getMessage();
           }
           if (msg != null) {
               KeyValue property = msg.getMessageBuilder().addProperty();
               property.setKey(key).setValue(value);
           }
   ```


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