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

[Java client] Fix behaviour of Schema.AUTO_CONSUME() with KeyValueSchema and multi versions #10492

Merged
merged 1 commit into from
May 7, 2021

Conversation

eolivelli
Copy link
Contributor

@eolivelli eolivelli commented May 6, 2021

Motivation:
Schema.AUTO_CONSUME() does not work with KeyValueSchema and multi version schemas.
This is because the generated AVRO Schema Reader is configured with useProvidedSchemaAsReaderSchema=true.

Add new test cases for this use case:

  • use Schema.AUTO_CONSUME() to consume a topic with KeyValue Schema with AVRO key and value
  • write different versions of the Schema
  • ensure that the Schema is handled correctly

We have two variants of the test:

  • without reopening the consumer (new test case, that failed without this fix)
  • reopening a new consumer (here we are enhancing a pre-existing test case)

@eolivelli eolivelli closed this May 6, 2021
@eolivelli eolivelli reopened this May 6, 2021
@eolivelli eolivelli force-pushed the fix/keyvalue-schema-evolution branch from e38aced to c9e892c Compare May 6, 2021 13:28
@eolivelli eolivelli changed the title [Test][Java client] Add test case for Consumer<GenericObject> and KeyValueSchema with schema versions [Java client] Fix behaviour of Schema.AUTO_CONSUME() with KeyValueSchema and multi versions May 6, 2021
@eolivelli eolivelli self-assigned this May 6, 2021
@eolivelli eolivelli added this to the 2.8.0 milestone May 6, 2021
@eolivelli
Copy link
Contributor Author

@codelipenghui this change is relevant only when you consume a KeyValue topic with AUTO_CONSUME() and you use the new GenericObject/getNativeObject() API.

this is not possible in 2.7.x, I am removing the 2.7.3 label

@merlimat merlimat merged commit 9b92dc2 into apache:master May 7, 2021
eolivelli added a commit to eolivelli/pulsar that referenced this pull request May 11, 2021
…ema and multi versions (apache#10492)

Co-authored-by: Enrico Olivelli <eolivelli@apache.org>
eolivelli added a commit to datastax/pulsar that referenced this pull request May 12, 2021
…ema and multi versions (apache#10492)

Co-authored-by: Enrico Olivelli <eolivelli@apache.org>
(cherry picked from commit 9b92dc2)
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.

None yet

4 participants