public class SchemaRegistryProvider extends SchemaProvider
https://github.com/confluentinc/schema-registry
| Modifier and Type | Class and Description |
|---|---|
static class |
SchemaRegistryProvider.Config
Configs supported.
|
| Constructor and Description |
|---|
SchemaRegistryProvider(TypedProperties props) |
| Modifier and Type | Method and Description |
|---|---|
String |
fetchSchemaFromRegistry(String registryUrl)
The method takes the provided url
registryUrl and gets the schema from the schema registry using that url. |
org.apache.avro.Schema |
getSourceSchema() |
protected InputStream |
getStream(HttpURLConnection connection) |
org.apache.avro.Schema |
getTargetSchema() |
protected void |
setAuthorizationHeader(String creds,
HttpURLConnection connection) |
public SchemaRegistryProvider(TypedProperties props)
public String fetchSchemaFromRegistry(String registryUrl) throws IOException
registryUrl and gets the schema from the schema registry using that url.
If the caller provides userInfo credentials in the url (e.g "https://foo:bar@schemaregistry.org") then the credentials
are extracted the url using the Matcher and the extracted credentials are set on the request as an Authorization
header.registryUrl - IOExceptionprotected void setAuthorizationHeader(String creds, HttpURLConnection connection)
protected InputStream getStream(HttpURLConnection connection) throws IOException
IOExceptionpublic org.apache.avro.Schema getSourceSchema()
getSourceSchema in class SchemaProviderpublic org.apache.avro.Schema getTargetSchema()
getTargetSchema in class SchemaProviderCopyright © 2023 The Apache Software Foundation. All rights reserved.