0

I use python confluent-kafka 1.5.0 with schema registry for consuming avro message from kafka.
I am only consumer, without access to admin producer or broker or something else.
I know topics name and from message fields i get subject and namespace also in schema registry client, sr client get schema using schema_id from message.
According my goal i need method get schema(only id or subject name) BEFORE i start consuming. That is mean , i want to get schema by topic name manually

Please, read attentively, i know how get schema manually after i get schema_id from message.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
  • If you know the topic name, then you know the subject name. Just use an HTTP client, not a Kafka consumer – OneCricketeer Oct 10 '21 at 12:37
  • Topic name and subject is different , for example: topic "event" and subject "some.domain.net.container" . I need method how confluent finds a match – shabelski89 Oct 10 '21 at 14:18
  • And yes, i can request directly to SR, but i want get schema by topic name – shabelski89 Oct 10 '21 at 14:21
  • Last I checked, the Python client doesn't have any way of getting the subject names set by the Java client, but you would need to have the schema defined in your Python code and parse the namespace+record name from it. Again, not consuming anything – OneCricketeer Oct 10 '21 at 15:50

1 Answers1

0

The only way to get the schema "before consuming" is to not consume and instead interact with the registry directly

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245