Skip to content

PIP-85 Message.getSchema - #14

Closed
eolivelli wants to merge 11 commits into
masterfrom
impl/message-getschema
Closed

eolivelli wants to merge 11 commits into
masterfrom
impl/message-getschema

Conversation

@eolivelli

Copy link
Copy Markdown
Owner
  • rename MessageImpl and TopicMessageImpl getSchema to getSchemaInternal
  • introduce Optional<Schema<?>> Message.getSchema()
  • introduce Schema.atSchemaVersion, that allows to get a Schema at a specific "version", this is needed for AutoConsumeSchema

The schema returned by Message.getSchema has these properties:

  • SchemaInfo it what is stored on the Registry
  • getNativeSchema returns the original AVRO Schema as expected
  • it can be used for "decoding" payloads
  • it cannot be used for "encoding" payloads

Objects.requireNonNull(schemaVersion);
if (schemaInfoProvider == null) {
// this schema is not downloaded from the registry
return this;

@dlg99 dlg99 May 4, 2021 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we care about supportSchemaVersioning() == false and/or schemaVersion equality in this case? Can we have compatible schema, i.e. v.2 is a good enough schema to read messages when v.1 is requested?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the case in which you have a static Schema (Consumer consumer = client.newConsumer(Schema.AVRO(MyPojo.class)), so it is not possible to use the SchemaRegistry and anyway the message is decoded using this static schema.

I am not sure it is worth to add more constraints here in this point.

if I add some other assertion here that case won't work, because the Schema that you pass to the Consumer does not have a "version".

@eolivelli

Copy link
Copy Markdown
Owner Author

Superseded by official PR
apache#10476

@eolivelli eolivelli closed this May 4, 2021
eolivelli pushed a commit that referenced this pull request Dec 17, 2021
* [Issue 9728] Upgrade GRPC and bookkeeper (apache#9729)

* Upgraded bookkeeper to 4.13.0; grpc to 1.33

Fixes apache#10937

*Motivation*

The previours bk version was introduce an incompatible issue
with BouncyCastle FIPS. BookKeeper already fix this and we
should upgrade the version to resolve the issue.

For more information: apache#10937

*Modifications*

* Upgrade to BookKeeper 4.14.3 (apache#12760)

* Fixed additional post-cherry-pick conflicts

Co-authored-by: hangc0276 <[email protected]>
Co-authored-by: chenhang <[email protected]>
Co-authored-by: Yong Zhang <[email protected]>
Co-authored-by: Matteo Merli <[email protected]>
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