shibd commented on PR #17125:
URL: https://github.com/apache/pulsar/pull/17125#issuecomment-1246830667

   > > I keep encoding type in KeyValue. Because if will remove it, will affect 
the API.
   > 
   > The encoding type is already included in the schema, which is set in the 
producer or consumer internally from `ProducerConfiguration` or 
`ConsumerConfiguration`, why removing it will affect the API? We don't need to 
set schema on a `MessageBuilder`.
   
   @BewareMyPower I thought of a way, but it's not very elegant.
   
   I add method `convert PayloadToKeyValue` and `convertKeyValueToPayload` on 
MessageImpl class. When the consumer receives a message after, will invoke 
`convert PayloadToKeyValue` to convert payload to KeyValue, When the producer 
sends a message before, will invoke `convert KeyValueToPayload` to convert 
KeyValue to the payload. PTAL.


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