Class DefaultSchemaRegistryClient
java.lang.Object
org.springframework.cloud.stream.schema.registry.client.DefaultSchemaRegistryClient
- All Implemented Interfaces:
SchemaRegistryClient
- Author:
- Marius Bogoevici, Vinicius Carvalho, Christian Tzolov
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultSchemaRegistryClient(org.springframework.boot.restclient.RestTemplateBuilder builder) DefaultSchemaRegistryClient(org.springframework.web.client.RestTemplate restTemplate) -
Method Summary
Modifier and TypeMethodDescriptionfetch(int id) Retrieves a schema by its identifier.fetch(SchemaReference schemaReference) Retrieves a schema by its reference (subject and version).protected Stringprotected org.springframework.web.client.RestTemplateRegisters a schema with the remote repository returning the unique identifier associated with this schema.voidsetEndpoint(String endpoint)
-
Constructor Details
-
DefaultSchemaRegistryClient
public DefaultSchemaRegistryClient(org.springframework.boot.restclient.RestTemplateBuilder builder) -
DefaultSchemaRegistryClient
public DefaultSchemaRegistryClient(org.springframework.web.client.RestTemplate restTemplate)
-
-
Method Details
-
getEndpoint
-
setEndpoint
-
getRestTemplate
protected org.springframework.web.client.RestTemplate getRestTemplate() -
register
Description copied from interface:SchemaRegistryClientRegisters a schema with the remote repository returning the unique identifier associated with this schema.- Specified by:
registerin interfaceSchemaRegistryClient- Parameters:
subject- the full name of the schemaformat- format of the schemaschema- string representation of the schema- Returns:
- a
SchemaRegistrationResponserepresenting the result of the operation
-
fetch
Description copied from interface:SchemaRegistryClientRetrieves a schema by its reference (subject and version).- Specified by:
fetchin interfaceSchemaRegistryClient- Parameters:
schemaReference- aSchemaReferenceused to identify the target schema.- Returns:
- schema
-
fetch
Description copied from interface:SchemaRegistryClientRetrieves a schema by its identifier.- Specified by:
fetchin interfaceSchemaRegistryClient- Parameters:
id- the id of the target schema.- Returns:
- schema
-