eolivelli opened a new issue #9899:
URL: https://github.com/apache/pulsar/issues/9899


   **Is your enhancement request related to a problem? Please describe.**
   In Pulsar IO we have Record#getKey that returns an Optional<String>, this 
way you cannot support non String keys.
   
   You can write Non string keys with:
   - with `KeyValue` 
   - With `MessageBuilder#keyBytes`
   
   **Describe the solution you'd like**
   I would like to see a Record#getKeyObject() (or other name) that returns the 
key as Object:
   - String if it is a string
   - byte[] if we have a base64encoded byte[]
   - Object in case of KeyValue payload (especially with SEPARATED encoding)
   
   **Describe alternatives you've considered**
   Using Record#getMessage#getKeyBytes() but it is not required for a Record to 
carry the original message
   
   **Additional context**
   This feature is needed in order to implement more advanced Sinks, in 
particular to be able to map the record key from Pulsar to Kafka and also in 
order to leverage Records that are using a GenericRecord as Key (see KeyValue 
with SEPARATED encoding)


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