-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Labels
lifecycle/staletype/enhancementThe enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messagesThe enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Description
Is your enhancement request related to a problem? Please describe.
In Pulsar IO we have Record#getKey that returns an Optional, 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)
Metadata
Metadata
Assignees
Labels
lifecycle/staletype/enhancementThe enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messagesThe enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages