Class SchemaRegistryApacheAvroSerializerBuilder
- java.lang.Object
-
- com.azure.data.schemaregistry.apacheavro.SchemaRegistryApacheAvroSerializerBuilder
-
public final class SchemaRegistryApacheAvroSerializerBuilder extends Object
The builder implementation for buildingSchemaRegistryApacheAvroSerializer
.- See Also:
SchemaRegistryApacheAvroSerializer
-
-
Constructor Summary
Constructors Constructor Description SchemaRegistryApacheAvroSerializerBuilder()
Instantiates instance of Builder class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SchemaRegistryApacheAvroSerializerBuilder
autoRegisterSchema(boolean autoRegisterSchemas)
If specified true, serializer will register schemas against Azure Schema Registry service under the specified group.SchemaRegistryApacheAvroSerializerBuilder
avroSpecificReader(boolean avroSpecificReader)
Specifies if objects should be deserialized into AvroSpecificRecord
via Avro'sSpecificDatumReader
.SchemaRegistryApacheAvroSerializer
buildSerializer()
Creates a new instance of Schema Registry serializer.SchemaRegistryApacheAvroSerializerBuilder
schemaGroup(String schemaGroup)
Specifies schema group for interacting with Azure Schema Registry service.SchemaRegistryApacheAvroSerializerBuilder
schemaRegistryAsyncClient(SchemaRegistryAsyncClient schemaRegistryAsyncClient)
TheSchemaRegistryAsyncClient
to use to interact with the Schema Registry service.
-
-
-
Method Detail
-
schemaGroup
public SchemaRegistryApacheAvroSerializerBuilder schemaGroup(String schemaGroup)
Specifies schema group for interacting with Azure Schema Registry service. This is optional unlessautoRegisterSchema
is set totrue
. If auto-registering schemas, schema will be stored under this group. If not auto-registering, serializer will request schema ID for matching data schema under specified group.- Parameters:
schemaGroup
- Azure Schema Registry schema group- Returns:
- updated
SchemaRegistryApacheAvroSerializerBuilder
instance
-
autoRegisterSchema
public SchemaRegistryApacheAvroSerializerBuilder autoRegisterSchema(boolean autoRegisterSchemas)
If specified true, serializer will register schemas against Azure Schema Registry service under the specified group. See Azure Schema Registry documentation for a description of schema registration behavior. If specified false, serializer will simply query the service for an existing ID given schema content. Serialization will fail if the schema has not been pre-created. Auto-registration is NOT RECOMMENDED for production scenarios.- Parameters:
autoRegisterSchemas
- flag for schema auto-registration- Returns:
- updated
SchemaRegistryApacheAvroSerializerBuilder
instance
-
avroSpecificReader
public SchemaRegistryApacheAvroSerializerBuilder avroSpecificReader(boolean avroSpecificReader)
Specifies if objects should be deserialized into AvroSpecificRecord
via Avro'sSpecificDatumReader
.- Parameters:
avroSpecificReader
-true
to deserialize intoSpecificRecord
viaSpecificDatumReader
;false
otherwise.- Returns:
- updated
SchemaRegistryApacheAvroSerializerBuilder
instance.
-
schemaRegistryAsyncClient
public SchemaRegistryApacheAvroSerializerBuilder schemaRegistryAsyncClient(SchemaRegistryAsyncClient schemaRegistryAsyncClient)
TheSchemaRegistryAsyncClient
to use to interact with the Schema Registry service.- Parameters:
schemaRegistryAsyncClient
- TheSchemaRegistryAsyncClient
.- Returns:
- updated
SchemaRegistryApacheAvroSerializerBuilder
instance.
-
buildSerializer
public SchemaRegistryApacheAvroSerializer buildSerializer()
Creates a new instance of Schema Registry serializer.- Returns:
- A new instance of
SchemaRegistryApacheAvroSerializer
. - Throws:
NullPointerException
- ifschemaRegistryAsyncClient(SchemaRegistryAsyncClient)
isnull
orschemaGroup
isnull
.IllegalArgumentException
- if credential is not set.
-
-