Confluent Schema Registry
Connecting
CLI
recap add my_csr http+csr://my-registry:8081
Environment Variables
export RECAP_SYSTEM__MY_CSR=http+csr://my-registry:8081
Python API
from recap.clients import create_client
with create_client("http+csr://my-registry:8081") as client:
client.ls()
Format
URLs
Recap’s Confluent Schema Registry client takes a URL pointing to the Confluent Schema Registry HTTP server.
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)
Paths
Recap’s Confluent Schema Registry paths are formatted as:
[system]/[topic]
You may optionally include -key
or -value
at the end of the path to specify the key or value schema, respectively. If no suffix is supplied -value
is assumed.
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.