CREATE SCHEMA_REGISTRY

Syntax

CREATE SCHEMA_REGISTRY
    schema_registry_name
WITH (schema_registry_parameter = value [, ... ]);

Description

Schema Registries are useful for storing and managing the many schemas that may define a user's data streams. These schemas are necessary for a system to marshal and unmarshal records and make sure the native data format matches the intended format. After creating a Schema Registry, look at how to UPDATE STORE to attach the Schema Registry to a Store. The Schema Registry that is created will be accessible to the user who created it and anyone who has been given permissions.

Schema Registry is required for working with Avro data

Currently supported Schema Registries are Confluent Cloud and Confluent Platform

Arguments

schema_registry_name

Specifies the name of the new Schema Registry. For case-sensitive names, the name must be wrapped in double quotes, otherwise, the lowercased name will be used.

WITH (schema_registry_parameter = value [, …​ ])

This clause specifies Schema Registry parameters; see Schema Registry Parameters below for more information.

Schema Registry Parameters

Parameter NameDescription

type

Required. Type of Schema Registry. Type: SCHEMA_REGISTRY_TYPE Valid values: CONFLUENT, CONFLUENT_CLOUD

access_region

Required, unless specified in properties.file. Region the Schema Registry resides in. Type: String Valid values: See LIST REGIONS

uris

Required, unless specified in properties.file. List of comma separated host:port URIs to connect to the Schema Registry. Type: String Valid values: Valid URI that corresponds with the Schema Registry.

properties.file

Optional. The file path to a yaml file containing other Schema Registry parameters. Default value: None Type: String Valid values: File path in current user's filesystem

Confluent Cloud Schema Registry Specific Parameters

Parameter NameDescription

confluent_cloud.key

Optional. Credentials key for the Confluent Cloud Schema Registry. Default: None Type: String Valid values: The key corresponding with the credential key pair associated with the Schema Registry.

confluent_cloud.secret

Optional. Credentials secret for the Confluent Cloud Schema Registry. Default: None Type: String Valid values: The secret corresponding with the credential key pair associated with the Schema Registry.

Confluent Platform Schema Registry Specific Parameters

Parameter NameDescription

confluent.username

Optional. Login username for the Confluent Platform Schema Registry. Default: None Type: String

confluent.password

Optional. Login password for the Confluent Platform Schema Registry. Default: None Type: String

tls.client.cert_file

Optional. File path to client certificate for mutual TLS authentication in PEM format. Default: None Type: String

tls.client.key_file

Optional. File path to client certificate key for mutual TLS authentication in PEM format. Default: None Type: String

Examples

Create a Confluent Cloud Schema Registry

The following is an example statement that creates a new CONFLUENT_CLOUD Schema Registry named ConfluentCloudSR:

CREATE SCHEMA_REGISTRY "ConfluentCloudSR" WITH (
    'type' = CONFLUENT_CLOUD,
    'access_region' = "AWS us-east-2",
    'uris' = 'https://abcd-efghi.us-east-2.aws.confluent.cloud',
    'confluent_cloud.key' = 'fake_key',
    'confluent_cloud.secret' = 'fake_secret'
);

Create a Confluent Platform Schema Registry

The following is an example statement that creates a new CONFLUENT Schema Registry named ConfluentPlatformSR:

CREATE SCHEMA_REGISTRY "ConfluentPlatformSR" WITH (
    'type' = CONFLUENT,
    'access_region' = "AWS us-east-2",
    'uris' = 'https://url.to.schema.registry.listener:8081',
    'confluent.username' = 'fake_username',
    'confluent.secret' = 'fake_password',
    'tls.client.cert_file' = '/path/to/tls/client_cert_file',
    'tls.client.key_file' = '/path/to/tls_key'
);

Create a Schema Registry with credentials from a file

The following creates a new CONFLUENT_CLOUD Schema Registry named ConfluentCloudSR:

CREATE SCHEMA_REGISTRY "ConfluentCloudSR" WITH (
    'type' = CONFLUENT_CLOUD,
    'properties.file' = '/User/user1/schema_registry/cc/properties.yaml'
);
$ cat /User/user1/schema_registry/cc/properties.yaml
access_region: "AWS us-east-2"
uris: "https://abcd-efghi.us-east-2.aws.confluent.cloud"
confluent_cloud.key: "SR_KEY"
confluent_cloud.secret: "SR_SECRET"

Last updated