public class SchemaRegistry extends Object
Constructor and Description |
---|
SchemaRegistry(Properties properties) |
SchemaRegistry(String apiurl,
String apikey,
boolean skipSslValidation) |
Modifier and Type | Method and Description |
---|---|
SchemaInfo |
getDefaultSchema()
Get the default schema as determined by the
SchemaRegistryConfig.PROPERTY_SCHEMA_ID_OVERRIDE
and SchemaRegistryConfig.PROPERTY_SCHEMA_VERSION_OVERRIDE configuration options. |
org.apache.kafka.common.header.Headers |
getOverrideHeaders()
Get the Kafka headers for the default schema as determined by the
SchemaRegistryConfig.PROPERTY_SCHEMA_ID_OVERRIDE
and SchemaRegistryConfig.PROPERTY_SCHEMA_VERSION_OVERRIDE configuration options. |
SchemaInfo |
getSchema(String schemaId,
int versionId)
Retrieves a single schema from the Registry.
|
SchemaInfo |
getSchema(String schemaName,
String versionName)
Retrieves a single schema from the Registry.
|
public SchemaRegistry(Properties properties) throws KeyManagementException, NoSuchAlgorithmException, SchemaRegistryAuthException, SchemaRegistryServerErrorException, SchemaRegistryApiException, SchemaRegistryConnectionException, SchemaNotFoundException, PropertyNotFoundException, InvalidPropertyValueException
properties
- a set of configuration propertiesKeyManagementException
- in the event of a failure to configure TLS for
the connection to the Schema RegistryNoSuchAlgorithmException
- in the event of a failure to configure TLS for
the connection to the Schema RegistrySchemaRegistryAuthException
- if there is a problem with the provided API keySchemaRegistryServerErrorException
- if the Schema Registry REST API
returns an HTTP 500 Internal Server ErrorSchemaRegistryApiException
- in the event of an unexpected response from
the Schema RegistrySchemaRegistryConnectionException
- in the event of a failure to connect to the
Schema Registry (e.g. a socket timeout)PropertyNotFoundException
- in the event a required property is not specifiedInvalidPropertyValueException
- in the event of a property set to an invalid valueSchemaNotFoundException
public SchemaRegistry(String apiurl, String apikey, boolean skipSslValidation) throws KeyManagementException, NoSuchAlgorithmException, SchemaRegistryAuthException, SchemaRegistryApiException, SchemaRegistryServerErrorException, SchemaRegistryConnectionException
apiurl
- url for the Event Streams REST APIapikey
- API key for use in accessing the Event Streams REST APIskipSslValidation
- if true, the hostname will not be verified in
certificates used for the TLS connection to
the Schema Registry REST API.
Available for use when the Event Streams installation
is using a self-signed certificate.KeyManagementException
- in the event of a failure to configure TLS for
the connection to the Schema RegistryNoSuchAlgorithmException
- in the event of a failure to configure TLS for
the connection to the Schema RegistrySchemaRegistryAuthException
- if there is a problem with the provided API keySchemaRegistryServerErrorException
- if the Schema Registry REST API
returns an HTTP 500 Internal Server ErrorSchemaRegistryApiException
- in the event of an unexpected response from
the Schema RegistrySchemaRegistryConnectionException
- in the event of a failure to connect to the
Schema Registry (e.g. a socket timeout)public SchemaInfo getSchema(String schemaId, int versionId) throws SchemaNotFoundException, SchemaRegistryAuthException, SchemaRegistryApiException, SchemaRegistryServerErrorException, SchemaRegistryConnectionException
schemaId
- ID of the schema to retrieveversionId
- integer value version ID of the schema to retrieveSchemaNotFoundException
- if the schema (or version) does not existSchemaRegistryAuthException
- if an auth error prevented the schema being fetchedSchemaRegistryServerErrorException
- if the Schema Registry failed to retrieve the schemaSchemaRegistryApiException
- in the event of an unexpected response from
the Schema RegistrySchemaRegistryConnectionException
- in the event of a failure to connect to the
Schema Registry (e.g. a socket timeout)public SchemaInfo getSchema(String schemaName, String versionName) throws SchemaNotFoundException, SchemaRegistryAuthException, SchemaRegistryApiException, SchemaRegistryServerErrorException, SchemaRegistryConnectionException
schemaName
- unique name of the schema to retrieveversionName
- version name of the schema to retrieveSchemaNotFoundException
- if the schema (or version) does not existSchemaRegistryAuthException
- if an auth error prevented the schema being fetchedSchemaRegistryServerErrorException
- if the Schema Registry failed to retrieve the schemaSchemaRegistryApiException
- in the event of an unexpected response from
the Schema RegistrySchemaRegistryConnectionException
- in the event of a failure to connect to the
Schema Registry (e.g. a socket timeout)public SchemaInfo getDefaultSchema()
SchemaRegistryConfig.PROPERTY_SCHEMA_ID_OVERRIDE
and SchemaRegistryConfig.PROPERTY_SCHEMA_VERSION_OVERRIDE
configuration options.public org.apache.kafka.common.header.Headers getOverrideHeaders()
SchemaRegistryConfig.PROPERTY_SCHEMA_ID_OVERRIDE
and SchemaRegistryConfig.PROPERTY_SCHEMA_VERSION_OVERRIDE
configuration options.Copyright © 2019. All rights reserved.