gaoran10 commented on issue #9851:
URL: https://github.com/apache/pulsar/issues/9851#issuecomment-793793167


   It seems that the source connector couldn't publish the properties along 
with the message content to the Pulsar topic.
   There is a config `forwardSourceMessageProperty` to determine whether set 
properties to the Pulsar message properties.
   But the source connector doesn't set this param, so its default value is 
`false`. If it's a function you could use the param 
`--forward-source-message-property` to set its value. Maybe we could add a new 
configuration for the source config to set the param 
`forwardSourceMessageProperty` or set its default value as `true` for the 
source connector.
   
   The method in the class `PulsarSink`.
   ```
   @Override
       public void write(Record<T> record) {
           SinkRecord<T> sinkRecord = (SinkRecord<T>) record;
           TypedMessageBuilder<T> msg = 
pulsarSinkProcessor.newMessage(sinkRecord);
         
           ...
           if (!record.getProperties().isEmpty() && 
pulsarSinkConfig.isForwardSourceMessageProperty()) {
               msg.properties(record.getProperties());
           }
           ...
   
           pulsarSinkProcessor.sendOutputMessage(msg, sinkRecord);
       }
   ```


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


Reply via email to