Consumer Configuration
AxualConsumerConfig
Namespace: Axual.Kafka.Proxy.Proxies.Axual
An AxualConsumer is configured in the same way a plain Kafka Consumer would be. A collection of key value pairs object which contains the appropriate configurations needs to be defined. The properties that need to be set are the SSL authorization specifics alongside the Axual Specific properties for authenticating and routing to an available Axual Cluster.
In our case instead of using the ConsumerConfig
, we use the overloaded AxualConsumerConfig
which
contains the additional Axual properties.
Usage
var config = new AxualConsumerConfig
{
// Axual Configuration
ApplicationId = "io.axual.example.client.avro.consumer.dotnet",
EndPoint = new UriBuilder("https",
ServerSettings.ENDPOINT_ADDRESS, ServerSettings.ENDPOINT_PORT).Uri,
Tenant = ServerSettings.TENANT,
Environment = ServerSettings.ENVIRONMENT,
// Standard SSL Configuration
SecurityProtocol = SecurityProtocol.Ssl,
SslKeystoreLocation = CONSUMER_KEYSTORE_RESOURCE_PATH,
SslKeystorePassword = KEYSTORE_PASSWORD,
EnableSslCertificateVerification = true,
SslCaLocation = ServerSettings.SSL_CA_PATH,
};
The properties used in the code snippet are summarized below:
Configuration | Type | Description |
---|---|---|
ApplicationId |
|
Identifier used for verifying ConsumerGroup authorization (as it appears on Self Service Portal) |
EndPoint |
|
Url of instance |
Tenant |
|
Name of the tenant to connect to |
Environment |
|
Name of the environment to connect to |
SecurityProtocol |
|
Protocol used to communicate with brokers |
SslKeystoreLocation |
|
Path to client’s keystore (PKCS#12) used for authentication. |
SslKeystorePassword |
|
Password to client’s keystore (PKCS#12) used for authentication. |
EnableSslCertificateVerification |
|
Enable OpenSSL’s builtin broker (server) certificate verification. This verification can be extended by the application by implementing a certificate_verify_cb. |
SslCaLocation |
|
File or directory path to CA certificate(s) for verifying the broker’s key. |