Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Event class to use with the serializer. #132

Open
marcosschroh opened this issue May 19, 2022 · 1 comment
Open

Create Event class to use with the serializer. #132

marcosschroh opened this issue May 19, 2022 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@marcosschroh
Copy link
Owner

When encode_record_with_schema_id or encode_record_with_schema is called with data/record, these methods should return an Event object containing the data/record, the payload (the data encoded), the schema_id used to serialize the data and possible kafka_headers rather than the payload encoded.

We want to do this in order to provide more information to the user.

The same should happen with the decode_message. Related to #129

class Event:
    def __init__(self, data, payload, schema_id):
        ...
   
    def headers(self):
       ...
@marcosschroh marcosschroh added the enhancement New feature or request label May 19, 2022
@marcosschroh marcosschroh added this to the Version 3 milestone May 19, 2022
@bboggs-streambit
Copy link
Contributor

@marcosschroh, do you ultimately want to make the return type of serialize and deserialize this Event type? Or should it be configurable?

Is the data the full Kafka message? Or is it just the key or value needing to be serialized or deserialized?
I ask because it sounds like you're envisioning that the headers would be available to pull out of it as a property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants