Skip to content

Issue #449: AvroConsumer: provide method to get schemas from last message decode #475

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

Closed

Conversation

soxofaan
Copy link
Contributor

This is an alternative take on issue #449 that tries to address some concerns raised in PR #453 :

  • overhead is minimal (no mixins, no dynamic wrapper type creation and other magic), so not being able to turn it off is less of a concern
  • no non-optional _schema attribute on the wrapper that might cause collisions or raise code style complaints for accessing a "private" attribute

On the other hand, this solution is conceptually bit uglier than #453 as the schema (id) is not associated with the returned message directly and has to be requested with an explicit calls.

Very rough usage example:

consumer = AvroConsumer()

# Get a message
msg = consumer.poll()

# Get key/value schema ids and schema objects
key_sid, value_sid = consumer.last_decode_schema_ids
key_schema, value_schema = consumer.last_decode_schemas()

@ghost
Copy link

ghost commented Oct 26, 2018

It looks like @soxofaan hasn't signed our Contributor License Agreement, yet.

The purpose of a CLA is to ensure that the guardian of a project's outputs has the necessary ownership or grants of rights over all contributions to allow them to distribute under the chosen licence.
Wikipedia

You can read and sign our full Contributor License Agreement here.

Once you've signed reply with [clabot:check] to prove it.

Appreciation of efforts,

clabot

@soxofaan
Copy link
Contributor Author

Please note: this is proof of concept to collect initial feedback (e.g. from @saabeilin, @rnpridgeon, @edenhill, involved in #453)
I'm planning to finetune documentation a bit and add tests

@soxofaan
Copy link
Contributor Author

[clabot:check]

@ghost
Copy link

ghost commented Oct 26, 2018

@confluentinc It looks like @soxofaan just signed our Contributor License Agreement. 👍

Always at your service,

clabot

@soxofaan soxofaan force-pushed the issue-449-get-decode-schemas branch from 9a90370 to c407e9c Compare November 7, 2018 00:07
@soxofaan soxofaan force-pushed the issue-449-get-decode-schemas branch from c407e9c to 0268943 Compare December 10, 2018 09:14
@soxofaan
Copy link
Contributor Author

rebased branch to resolve merge conflicts

@rnpridgeon
Copy link
Contributor

Generic Serde support will provide a means to bind your schema with your data. This is similar to java's 'GenericRecord' implementation. #502

@rnpridgeon rnpridgeon closed this Jan 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants