Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

ISSUE-10438: Add a Message.getSchema() in the client API #2468

Closed
sijie opened this issue Apr 29, 2021 · 0 comments
Closed

ISSUE-10438: Add a Message.getSchema() in the client API #2468

sijie opened this issue Apr 29, 2021 · 0 comments

Comments

@sijie
Copy link
Member

sijie commented Apr 29, 2021

Original Issue: apache#10438


When the schema is not known at compile time, a Consumer<GenericObject> should be able to get the message schema.

Currently, a Consumer<GenericRecord> can get the AVRO message and retreive its schema, but if the message is a KeyValue for example, there is no way to get the actual Schema.

The idea is to introduce a CompletableFuture<Schema<?>> getSchema() in the Message API, returning null by default.

The implementation classes (MessageImpl, TopicMessageImpl) could then fetch the Schema if available, and eventually keep it cached as a class member.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant