Confluent Schema Registry
Connecting
CLI
recap ls http+csr://my-registry:8081/some/root/path
recap schema http+csr://my-registry:8081/some/root/path/my-topic
Python API
from recap.clients import create_client
with create_client("http+csr://my-registry:8081/some/root/path") as client:
client.ls()
client.schema("my-topic")
URLs
Recap’s Confluent Schema Registry client takes a URL pointing to the Confluent Schema Registry HTTP server and an optional subject path.
http+csr://[host]:[port]/[path*]/[subject]
You may optionally include -key
or -value
at the end of the subject name to specify the key or value schema, respectively. If no suffix is supplied -value
is assumed.
The scheme must be http+csr
or https+csr
. The +csr
suffix is required to distinguish this client from other clients that also use HTTP connections (similar to SQLAlchemy’s dialect+driver
format)
Type Conversion
ConfluentRegistryClient.get_schema()
uses the AvroConverter
, JSONSchemaConverter
, and ProtobufConverter
classes to convert schemas, based on their type.
Please see the individual documentation for these classes for information on how they convert types:
- Avro: AvroConverter
- JSON schema: JSONSchemaConverter
- Protocol Buffers: ProtobufConverter
Limitations and Constraints
- ConfluentRegistryClient does not support schema references.
The conversion functions raise a ValueError
exception if the conversion is not possible.