Class SchemaRegistryClientBuilder

java.lang.Object
com.azure.data.schemaregistry.SchemaRegistryClientBuilder
All Implemented Interfaces:
ConfigurationTrait<SchemaRegistryClientBuilder>, HttpTrait<SchemaRegistryClientBuilder>, TokenCredentialTrait<SchemaRegistryClientBuilder>

Fluent builder for interacting with the Schema Registry service via SchemaRegistryAsyncClient and SchemaRegistryClient. To build the client, the builder requires the service endpoint of the Schema Registry and an Azure AD credential.

Instantiating the client

 // AAD credential to authorize with Schema Registry service.
 DefaultAzureCredential azureCredential = new DefaultAzureCredentialBuilder()
     .build();
 SchemaRegistryClient client = new SchemaRegistryClientBuilder()
     .fullyQualifiedNamespace("https://<your-schema-registry-endpoint>.servicebus.windows.net")
     .credential(azureCredential)
     .buildClient();
 

Instantiating the async client

 // AAD credential to authorize with Schema Registry service.
 DefaultAzureCredential azureCredential = new DefaultAzureCredentialBuilder()
     .build();
 SchemaRegistryAsyncClient client = new SchemaRegistryClientBuilder()
     .fullyQualifiedNamespace("https://<your-schema-registry-endpoint>.servicebus.windows.net")
     .credential(azureCredential)
     .buildAsyncClient();
 

Instantiating with custom retry policy and HTTP log options

 DefaultAzureCredential azureCredential = new DefaultAzureCredentialBuilder()
     .build();

 HttpLogOptions httpLogOptions = new HttpLogOptions()
     .setLogLevel(HttpLogDetailLevel.BODY)
     .setPrettyPrintBody(true);

 RetryPolicy retryPolicy = new RetryPolicy(new FixedDelay(5, Duration.ofSeconds(30)));
 SchemaRegistryAsyncClient client = new SchemaRegistryClientBuilder()
     .fullyQualifiedNamespace("https://<your-schema-registry-endpoint>.servicebus.windows.net")
     .httpLogOptions(httpLogOptions)
     .retryPolicy(retryPolicy)
     .credential(azureCredential)
     .buildAsyncClient();