Axual Client Reference

ClientConfig

Package: io.axual.common.config

This class represents the configuration that must be passed to AxualClient to build an object that communicates with Kafka brokers and Discovery API.

Usage

ClientConfig.newBuilder()
	.setEndpoint("...") (1)
	.setApplicationId("...") (2)
	.setApplicationVersion("...") (3)
	.setTenant("...") (4)
	.setEnvironment("...") (5)
	.setSslConfig(...) (6)
	.setEnableHostnameVerification(false)
	.build());
1 URL of Discovery API endpoint.
2 A unique string identifying the application, see also self-service/user-guide.adoc#app-id in the Self Service User Guide.
3 Version of the application.
4 Tenant identifier.
5 Environment defined within the tenant.
6 Configuration for SSL connection. Refer below.

SslConfig

Package: io.axual.common.config

Build this config to setup the keystore and truststore properties required for SSL communication with Kafka brokers.

SslConfig.newBuilder()
	.setKeystoreLocation("...")
	.setKeyPassword(new PasswordConfig("..."))
	.setKeystorePassword(new PasswordConfig("..."))
	.setTruststoreLocation("...")
	.setTruststorePassword(new PasswordConfig("..."))
	.build();

PasswordConfig

Package: io.axual.common.config

Wrapper for specifying passwords for different properties.

AxualClient

Package: io.axual.client

This class is initialized with ClientConfig object to setup the communication with Kafka Cluster. An object of this class can be used to build producers and consumers.

Usage

ClientConfig clientConfig = ...

AxualClient client = new AxualClient(clientConfig);

Producer<K, V> producer = client.buildProducer(...);

Consumer<K, V> consumer = client.buildConsumer(...);

A single instance of AxualClient can be used to build multiple producer and consumer objects.

AxualClient is not thread-safe.