Bomby
Bomby

Reputation: 23

Retrieving specific subjects/schema from Confluent Kafka Schema Registry

I am using the Confluent Kafka Schema registry and have some schema/subjects defined.

Few examples:

  dev.delivery.kafka.delivery-reason-value
  dev.delivery.kafka.delivery-day-value
  dev.travel.kafka.places-ice-value

When I use confluent CLI and connect to the registry, I run the below commands:

#this gives me all the subjects/schemas defined in the registry --perfectly fine :)
confluent schema-registry subject list --prefix ":*:" 

But, when I want to retrieve the specific topic's schema, for instance only the schema which has travel word in it

#this gives me "No Subjects."
confluent schema-registry subject list --prefix ":travel:"

OR

confluent schema-registry subject list --prefix ":*travel*:"

Can anyone help me here if I am missing something on the wild cards within the prefix?

Thanks in Advance

Upvotes: 0

Views: 660

Answers (1)

OneCricketeer
OneCricketeer

Reputation: 191671

You don't really need that CLI. This is easily done with Python, for example.

import requests

r = requests.get('http://registry:8081/subjects')
for subject in r.json():
  if 'travel' in subject:  # example
    print(subject)

Upvotes: 0

Related Questions