Table of Contents

Class KafkaClientsConfigurationBuilder

Namespace
Silverback.Messaging.Configuration.Kafka
Assembly
Silverback.Integration.Kafka.dll

Configures the Kafka producers and consumers building the KafkaProducerConfiguration and KafkaConsumerConfiguration.

public class KafkaClientsConfigurationBuilder
Inheritance
KafkaClientsConfigurationBuilder
Inherited Members

Constructors

KafkaClientsConfigurationBuilder()

public KafkaClientsConfigurationBuilder()

Methods

AddConsumer(Action<KafkaConsumerConfigurationBuilder>)

Adds a Kafka consumer.

public KafkaClientsConfigurationBuilder AddConsumer(Action<KafkaConsumerConfigurationBuilder> configurationBuilderAction)

Parameters

configurationBuilderAction Action<KafkaConsumerConfigurationBuilder>

An Action that takes the KafkaConsumerConfigurationBuilder and configures it.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

AddConsumer(string, Action<KafkaConsumerConfigurationBuilder>)

Adds a Kafka consumer or updates its configuration if a consumer with the same name already exists.

public KafkaClientsConfigurationBuilder AddConsumer(string name, Action<KafkaConsumerConfigurationBuilder> configurationBuilderAction)

Parameters

name string

The consumer name.

configurationBuilderAction Action<KafkaConsumerConfigurationBuilder>

An Action that takes the KafkaConsumerConfigurationBuilder and configures it.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

AddDefaultConsumerConfiguration(Action<KafkaConsumerConfigurationBuilder>)

Add a default consumer configuration that will be applied to all the consumers.
This configuration action will be applied before any other consumer-specific configuration action.

public KafkaClientsConfigurationBuilder AddDefaultConsumerConfiguration(Action<KafkaConsumerConfigurationBuilder> configurationBuilderAction)

Parameters

configurationBuilderAction Action<KafkaConsumerConfigurationBuilder>

An Action that takes the KafkaConsumerConfigurationBuilder and configures it.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

AddDefaultProducerConfiguration(Action<KafkaProducerConfigurationBuilder>)

Add a default producer configuration that will be applied to all the producers.
This configuration action will be applied before any other producer-specific configuration action.

public KafkaClientsConfigurationBuilder AddDefaultProducerConfiguration(Action<KafkaProducerConfigurationBuilder> configurationBuilderAction)

Parameters

configurationBuilderAction Action<KafkaProducerConfigurationBuilder>

An Action that takes the KafkaProducerConfigurationBuilder and configures it.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

AddProducer(Action<KafkaProducerConfigurationBuilder>)

Adds a Kafka producer.

public KafkaClientsConfigurationBuilder AddProducer(Action<KafkaProducerConfigurationBuilder> configurationBuilderAction)

Parameters

configurationBuilderAction Action<KafkaProducerConfigurationBuilder>

An Action that takes the KafkaProducerConfigurationBuilder and configures it.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

AddProducer(string, Action<KafkaProducerConfigurationBuilder>)

Adds a Kafka producer or updates its configuration if a producer with the same name already exists.

public KafkaClientsConfigurationBuilder AddProducer(string name, Action<KafkaProducerConfigurationBuilder> configurationBuilderAction)

Parameters

name string

The producer name.

configurationBuilderAction Action<KafkaProducerConfigurationBuilder>

An Action that takes the KafkaProducerConfigurationBuilder and configures it.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

DisableApiVersionRequest()

Disables the API versions requests and uses the fallback version specified in BrokerVersionFallback.

public KafkaClientsConfigurationBuilder DisableApiVersionRequest()

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

DisableMetricsPush()

Disables pushing of client metrics to the cluster.

public KafkaClientsConfigurationBuilder DisableMetricsPush()

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

DisableSaslOauthbearerUnsecureJwt()

Disables the builtin unsecure JWT OAUTHBEARER token handler. This builtin handler should only be used for development or testing, and not in production.

public KafkaClientsConfigurationBuilder DisableSaslOauthbearerUnsecureJwt()

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

DisableSocketKeepalive()

Disables the TCP keep-alive (SO_KEEPALIVE) on the broker sockets.

public KafkaClientsConfigurationBuilder DisableSocketKeepalive()

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

DisableSocketNagle()

Disables the Nagle's algorithm (TCP_NODELAY) on the broker sockets.

public KafkaClientsConfigurationBuilder DisableSocketNagle()

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

DisableSparseTopicMetadataRefresh()

Disables sparse topic metadata requests.

public KafkaClientsConfigurationBuilder DisableSparseTopicMetadataRefresh()

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

DisableSslCertificateVerification()

Disables the SSL certificate validation.

public KafkaClientsConfigurationBuilder DisableSslCertificateVerification()

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

EnableApiVersionRequest()

Enables the API versions requests to adjust the functionality according to the available protocol features. If the request fails, the fallback version specified in BrokerVersionFallback will be used.

public KafkaClientsConfigurationBuilder EnableApiVersionRequest()

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

EnableMetricsPush()

Enables pushing of client metrics to the cluster, if the cluster has a client metrics subscription which matches this client.

public KafkaClientsConfigurationBuilder EnableMetricsPush()

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

EnableSaslOauthbearerUnsecureJwt()

Enables the builtin unsecure JWT OAUTHBEARER token handler. This builtin handler should only be used for development or testing, and not in production.

public KafkaClientsConfigurationBuilder EnableSaslOauthbearerUnsecureJwt()

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

EnableSocketKeepalive()

Enables the TCP keep-alive (SO_KEEPALIVE) on the broker sockets.

public KafkaClientsConfigurationBuilder EnableSocketKeepalive()

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

EnableSocketNagle()

Enables the Nagle's algorithm (TCP_NODELAY) on the broker sockets.

public KafkaClientsConfigurationBuilder EnableSocketNagle()

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

EnableSparseTopicMetadataRefresh()

Enables Generates less topic metadata requests (consuming less network bandwidth).

public KafkaClientsConfigurationBuilder EnableSparseTopicMetadataRefresh()

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

EnableSslCertificateVerification()

Enables the SSL certificate validation.

public KafkaClientsConfigurationBuilder EnableSslCertificateVerification()

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithAcks(Acks?)

Sets the number of acknowledgements that the leader broker must receive from the in-sync replicas before responding to the request: Confluent.Kafka.Acks.None (no response/ack is sent to the client), Confluent.Kafka.Acks.Leader (the leader will write the record to its local log but will respond without awaiting full acknowledgement from all followers, or Confluent.Kafka.Acks.All (the broker will block until the message is committed by all in-sync replicas. If there are less than min.insync.replicas (broker configuration) in the in-sync replicas set the produce request will fail.

public KafkaClientsConfigurationBuilder WithAcks(Acks? acks)

Parameters

acks Acks?

The number of acknowledgements that the leader broker must receive from the in-sync replicas.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithApiVersionFallbackMs(int?)

Sets how long the BrokerVersionFallback is used in the case the API version request fails.

public KafkaClientsConfigurationBuilder WithApiVersionFallbackMs(int? apiVersionFallbackMs)

Parameters

apiVersionFallbackMs int?

How long the fallback API version must be used.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithApiVersionRequestTimeoutMs(int?)

Sets the timeout (in milliseconds) for the broker API version requests.

public KafkaClientsConfigurationBuilder WithApiVersionRequestTimeoutMs(int? apiVersionRequestTimeoutMs)

Parameters

apiVersionRequestTimeoutMs int?

The timeout for the broker API version requests.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithBootstrapServers(string?)

Sets the comma-separated list of brokers (host or host:port).

public KafkaClientsConfigurationBuilder WithBootstrapServers(string? bootstrapServers)

Parameters

bootstrapServers string

The comma-separated list of brokers.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithBrokerAddressFamily(BrokerAddressFamily?)

Sets the allowed broker IP address families.

public KafkaClientsConfigurationBuilder WithBrokerAddressFamily(BrokerAddressFamily? brokerAddressFamily)

Parameters

brokerAddressFamily BrokerAddressFamily?

The allowed broker IP address families.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithBrokerAddressTtl(int?)

Sets the duration in milliseconds of the cache of the broker address resolving results.

public KafkaClientsConfigurationBuilder WithBrokerAddressTtl(int? brokerAddressTtl)

Parameters

brokerAddressTtl int?

The duration in milliseconds of the cache of the broker address resolving results.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithBrokerVersionFallback(string?)

Sets the broker API version to be used when the API version request fails or it's disabled. Older broker versions (before 0.10.0) don't support the API version request. Valid values are: 0.9.0, 0.8.2, 0.8.1, 0.8.0. Any other value >= 0.10, such as 0.10.2.1, enables the ApiVersionRequest.

public KafkaClientsConfigurationBuilder WithBrokerVersionFallback(string? brokerVersionFallback)

Parameters

brokerVersionFallback string

The broker API version to be used as fallback.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithCancellationDelayMaxMs(int)

Sets the maximum time (in milliseconds) before a cancellation request is acted on. Low values may result in measurably higher CPU usage.

public KafkaClientsConfigurationBuilder WithCancellationDelayMaxMs(int cancellationDelayMaxMs)

Parameters

cancellationDelayMaxMs int

The maximum time (in milliseconds) before a cancellation request is acted on.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithClientDnsLookup(ClientDnsLookup?)

Sets a value indicating how the client uses DNS lookups. By default, when the lookup returns multiple IP addresses for a hostname, they will all be attempted for connection before the connection is considered failed. This applies to both bootstrap and advertised servers. If the value is set to Confluent.Kafka.ClientDnsLookup.ResolveCanonicalBootstrapServersOnly, each entry will be resolved and expanded into a list of canonical names. Warning: Confluent.Kafka.ClientDnsLookup.ResolveCanonicalBootstrapServersOnly must only be used with Confluent.Kafka.SaslMechanism.Gssapi (Kerberos), as it's the only purpose of this configuration value. Note: Default here is different from the Java client's default behavior, which connects only to the first IP address returned for a hostname.

public KafkaClientsConfigurationBuilder WithClientDnsLookup(ClientDnsLookup? clientDnsLookup)

Parameters

clientDnsLookup ClientDnsLookup?

A value indicating how the client uses DNS lookups.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithClientId(string?)

Sets the client identifier.

public KafkaClientsConfigurationBuilder WithClientId(string? clientId)

Parameters

clientId string

The client identifier.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithClientRack(string?)

Sets the rack identifier for this client. This can be any string value which indicates where this client is physically located.

public KafkaClientsConfigurationBuilder WithClientRack(string? clientRack)

Parameters

clientRack string

The rack identifier for this client.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithConnectionsMaxIdleMs(int?)

Sets the maximum time of inactivity (in milliseconds) before closing the broker connections. Disable with 0. If this property is left at its default value some heuristics are performed to determine a suitable default value.

public KafkaClientsConfigurationBuilder WithConnectionsMaxIdleMs(int? connectionsMaxIdleMs)

Parameters

connectionsMaxIdleMs int?

The maximum time of inactivity.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithDebug(string?)

Sets a comma-separated list of debug contexts to enable. Detailed producer debugging: broker,topic,msg. Detailed consumer debugging: consumer,cgrp,topic,fetch.

public KafkaClientsConfigurationBuilder WithDebug(string? debug)

Parameters

debug string

The comma-separated list of debug contexts to enable.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithHttpsCaLocation(string?)

Gets the file or directory path to CA certificate(s) for verifying HTTPS endpoints, such as sasl.oauthbearer.token.endpoint.url used for OAUTHBEARER/OIDC authentication. Mutually exclusive with HttpsCaPem. Defaults: On Windows the system's CA certificates are automatically looked up in the Windows Root certificate store. On Mac OSX this configuration defaults to probe. It is recommended to install openssl using Homebrew to provide CA certificates. On Linux install the distribution's ca-certificates package. If OpenSSL is statically linked or https.ca.location is set to probe a list of standard paths will be probed and the first one found will be used as the default CA certificate location path. If OpenSSL is dynamically linked the OpenSSL library's default path will be used (see OPENSSLDIR in openssl version -a).

public KafkaClientsConfigurationBuilder WithHttpsCaLocation(string? httpsCaLocation)

Parameters

httpsCaLocation string

The file or directory path to CA certificate(s) for verifying HTTPS endpoints.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithHttpsCaPem(string?)

Sets the CA certificate string (in PEM format) for verifying HTTPS endpoints. Mutually exclusive with HttpsCaLocation.

public KafkaClientsConfigurationBuilder WithHttpsCaPem(string? httpsCaPem)

Parameters

httpsCaPem string

The CA certificate string (in PEM format) for verifying HTTPS endpoints.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithMaxInFlight(int?)

Sets the maximum number of in-flight requests per broker connection. This is a generic property applied to all broker communication, however it is primarily relevant to produce requests. In particular, note that other mechanisms limit the number of outstanding consumer fetch request per broker to one.

public KafkaClientsConfigurationBuilder WithMaxInFlight(int? maxInFlight)

Parameters

maxInFlight int?

The maximum number of in-flight requests per broker connection.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithMessageCopyMaxBytes(int?)

Sets the maximum size for a message to be copied into the buffer. Messages larger than this will be passed by reference (zero-copy) at the expense of larger iovecs.

public KafkaClientsConfigurationBuilder WithMessageCopyMaxBytes(int? messageCopyMaxBytes)

Parameters

messageCopyMaxBytes int?

The maximum size for a message to be copied into the buffer.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithMessageMaxBytes(int?)

Sets the maximum message size.

public KafkaClientsConfigurationBuilder WithMessageMaxBytes(int? messageMaxBytes)

Parameters

messageMaxBytes int?

The maximum message size.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithMetadataMaxAgeMs(int?)

Sets the metadata cache max age (in milliseconds). Defaults to TopicMetadataRefreshIntervalMs.

public KafkaClientsConfigurationBuilder WithMetadataMaxAgeMs(int? metadataMaxAgeMs)

Parameters

metadataMaxAgeMs int?

The metadata cache max age.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithMetadataRecoveryRebootstrapTriggerMs(int?)

Sets the metadata recovery rebootstrap trigger interval (ms). When using Confluent.Kafka.MetadataRecoveryStrategy.Rebootstrap, if the client is unable to obtain metadata from any of the known brokers for the specified interval, the client repeats the bootstrap process using the configured bootstrap.servers and brokers added through rd_kafka_brokers_add().

public KafkaClientsConfigurationBuilder WithMetadataRecoveryRebootstrapTriggerMs(int? metadataRecoveryRebootstrapTriggerMs)

Parameters

metadataRecoveryRebootstrapTriggerMs int?

The interval, in milliseconds, after which the client will rebootstrap if metadata cannot be obtained. Default: 300000 (5 minutes).

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithMetadataRecoveryStrategy(MetadataRecoveryStrategy?)

Sets the metadata recovery strategy. If set to Confluent.Kafka.MetadataRecoveryStrategy.None the client doesn't re-bootstrap. If set to Confluent.Kafka.MetadataRecoveryStrategy.Rebootstrap the client repeats the bootstrap process using the configured bootstrap.servers and brokers added through rd_kafka_brokers_add(). Rebootstrapping is useful when a client talks to brokers so infrequently that the broker set may change entirely before the client refreshes metadata. Metadata recovery is triggered when all last-known brokers appear unavailable simultaneously, when the client cannot refresh metadata within the configured rebootstrap trigger interval, or when requested in a metadata response.

public KafkaClientsConfigurationBuilder WithMetadataRecoveryStrategy(MetadataRecoveryStrategy? metadataRecoveryStrategy)

Parameters

metadataRecoveryStrategy MetadataRecoveryStrategy?

The metadata recovery strategy to use. See Confluent.Kafka.MetadataRecoveryStrategy for available values. Default: Confluent.Kafka.MetadataRecoveryStrategy.Rebootstrap.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithPluginLibraryPaths(string?)

Sets the list of plugin libraries to load (; separated). The library search path is platform dependent. If no filename extension is specified the platform-specific extension (such as .dll or .so) will be appended automatically.

public KafkaClientsConfigurationBuilder WithPluginLibraryPaths(string? pluginLibraryPaths)

Parameters

pluginLibraryPaths string

The list of plugin libraries to load (; separated).

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithReceiveMessageMaxBytes(int?)

Sets the maximum response message size. This serves as a safety precaution to avoid memory exhaustion in case of protocol hickups. This value must be at least FetchMaxBytes + 512 to allow for protocol overhead. The value is adjusted automatically unless the configuration property is explicitly set.

public KafkaClientsConfigurationBuilder WithReceiveMessageMaxBytes(int? receiveMessageMaxBytes)

Parameters

receiveMessageMaxBytes int?

The maximum response message size.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithReconnectBackoffMaxMs(int?)

Sets the maximum time (in milliseconds) to wait before reconnecting to a broker after the connection has been closed.

public KafkaClientsConfigurationBuilder WithReconnectBackoffMaxMs(int? reconnectBackoffMaxMs)

Parameters

reconnectBackoffMaxMs int?

The maximum time to wait before reconnecting to a broker.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithReconnectBackoffMs(int?)

Sets the initial time (in milliseconds) to wait before reconnecting to a broker after the connection has been closed. The time is increased exponentially until ReconnectBackoffMaxMs is reached. -25% to +50% jitter is applied to each reconnect backoff. A value of 0 disables the backoff and reconnects immediately.

public KafkaClientsConfigurationBuilder WithReconnectBackoffMs(int? reconnectBackoffMs)

Parameters

reconnectBackoffMs int?

The initial time to wait before reconnecting to a broker.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithRetryBackoffMaxMs(int?)

Sets the maximum backoff time in milliseconds before retrying a protocol request, this is the maximum backoff allowed for exponentially backed off requests.

public KafkaClientsConfigurationBuilder WithRetryBackoffMaxMs(int? retryBackoffMaxMs)

Parameters

retryBackoffMaxMs int?

The maximum backoff time in milliseconds before retrying a protocol request.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithRetryBackoffMs(int?)

Sets the backoff time in milliseconds before retrying a protocol request, this is the first backoff time, and will be backed off exponentially until number of retries is exhausted, and it's capped with RetryBackoffMaxMs.

public KafkaClientsConfigurationBuilder WithRetryBackoffMs(int? retryBackoffMs)

Parameters

retryBackoffMs int?

The backoff time in milliseconds before retrying a protocol request.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslKerberosKeytab(string?)

Sets the path to the Kerberos keytab file. This configuration property is only used as a variable in SaslKerberosKinitCmd as ... -t "%{sasl.kerberos.keytab}".

public KafkaClientsConfigurationBuilder WithSaslKerberosKeytab(string? saslKerberosKeytab)

Parameters

saslKerberosKeytab string

The path to the Kerberos keytab file.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslKerberosKinitCmd(string?)

Sets the shell command to be used to refresh or acquire the client's Kerberos ticket. This command is executed on client creation and every SaslKerberosMinTimeBeforeRelogin (0=disable).

public KafkaClientsConfigurationBuilder WithSaslKerberosKinitCmd(string? saslKerberosKinitCmd)

Parameters

saslKerberosKinitCmd string

The shell command to be used to refresh or acquire the client's Kerberos ticket.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslKerberosMinTimeBeforeRelogin(int?)

Sets the minimum time in milliseconds between each key refresh attempts. Disable automatic key refresh by setting this property to 0.

public KafkaClientsConfigurationBuilder WithSaslKerberosMinTimeBeforeRelogin(int? saslKerberosMinTimeBeforeRelogin)

Parameters

saslKerberosMinTimeBeforeRelogin int?

The minimum time in milliseconds between each key refresh attempts.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslKerberosPrincipal(string?)

Sets the client's Kerberos principal name. (Not supported on Windows, will use the logon user's principal).

public KafkaClientsConfigurationBuilder WithSaslKerberosPrincipal(string? saslKerberosPrincipal)

Parameters

saslKerberosPrincipal string

The client's Kerberos principal name. (Not supported on Windows, will use the logon user's principal).

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslKerberosServiceName(string?)

Sets the Kerberos principal name that Kafka runs as, not including /hostname@REALM.

public KafkaClientsConfigurationBuilder WithSaslKerberosServiceName(string? saslKerberosServiceName)

Parameters

saslKerberosServiceName string

The Kerberos principal name that Kafka runs as.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslMechanism(SaslMechanism?)

Sets the SASL mechanism to use for authentication. Supported: GSSAPI, PLAIN, SCRAM-SHA-256, SCRAM-SHA-512.

public KafkaClientsConfigurationBuilder WithSaslMechanism(SaslMechanism? saslMechanism)

Parameters

saslMechanism SaslMechanism?

The SASL mechanism.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslOauthbearerAssertionAlgorithm(SaslOauthbearerAssertionAlgorithm?)

Sets the algorithm the client should use to sign the assertion sent to the identity provider and in the OAuth alg header in the JWT assertion.

public KafkaClientsConfigurationBuilder WithSaslOauthbearerAssertionAlgorithm(SaslOauthbearerAssertionAlgorithm? saslOauthbearerAssertionAlgorithm)

Parameters

saslOauthbearerAssertionAlgorithm SaslOauthbearerAssertionAlgorithm?

The algorithm the client should use to sign the assertion sent to the identity provider and in the OAuth alg header in the JWT assertion.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslOauthbearerAssertionClaimAud(string?)

Sets the JWT audience claim. Only used when sasl.oauthbearer.method is set to "oidc" and JWT assertion is needed.

public KafkaClientsConfigurationBuilder WithSaslOauthbearerAssertionClaimAud(string? saslOauthbearerAssertionClaimAud)

Parameters

saslOauthbearerAssertionClaimAud string

The JWT audience claim.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslOauthbearerAssertionClaimExpSeconds(int?)

Sets the assertion expiration time in seconds. Only used when sasl.oauthbearer.method is set to "oidc" and JWT assertion is needed.

public KafkaClientsConfigurationBuilder WithSaslOauthbearerAssertionClaimExpSeconds(int? saslOauthbearerAssertionClaimExpSeconds)

Parameters

saslOauthbearerAssertionClaimExpSeconds int?

The assertion expiration time in seconds.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslOauthbearerAssertionClaimIss(string?)

Sets the JWT issuer claim. Only used when sasl.oauthbearer.method is set to "oidc" and JWT assertion is needed.

public KafkaClientsConfigurationBuilder WithSaslOauthbearerAssertionClaimIss(string? saslOauthbearerAssertionClaimIss)

Parameters

saslOauthbearerAssertionClaimIss string

The JWT issuer claim.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslOauthbearerAssertionClaimJtiInclude(bool?)

Sets the JWT ID claim. When set to true, a random UUID is generated. Only used when sasl.oauthbearer.method is set to "oidc" and JWT assertion is needed.

public KafkaClientsConfigurationBuilder WithSaslOauthbearerAssertionClaimJtiInclude(bool? saslOauthbearerAssertionClaimJtiInclude)

Parameters

saslOauthbearerAssertionClaimJtiInclude bool?

The JWT ID claim.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslOauthbearerAssertionClaimNbfSeconds(int?)

Sets the assertion not before time in seconds. Only used when sasl.oauthbearer.method is set to "oidc" and JWT assertion is needed.

public KafkaClientsConfigurationBuilder WithSaslOauthbearerAssertionClaimNbfSeconds(int? saslOauthbearerAssertionClaimNbfSeconds)

Parameters

saslOauthbearerAssertionClaimNbfSeconds int?

The assertion not before time in seconds.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslOauthbearerAssertionClaimSub(string?)

Sets the JWT subject claim. Only used when sasl.oauthbearer.method is set to "oidc" and JWT assertion is needed.

public KafkaClientsConfigurationBuilder WithSaslOauthbearerAssertionClaimSub(string? saslOauthbearerAssertionClaimSub)

Parameters

saslOauthbearerAssertionClaimSub string

The JWT subject claim.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslOauthbearerAssertionFile(string?)

Sets the path to the assertion file. Only used when sasl.oauthbearer.method is set to "oidc" and JWT assertion is needed.

public KafkaClientsConfigurationBuilder WithSaslOauthbearerAssertionFile(string? saslOauthbearerAssertionFile)

Parameters

saslOauthbearerAssertionFile string

The path to the assertion file.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslOauthbearerAssertionJwtTemplateFile(string?)

Sets the path to the JWT template file. Only used when sasl.oauthbearer.method is set to "oidc" and JWT assertion is needed.

public KafkaClientsConfigurationBuilder WithSaslOauthbearerAssertionJwtTemplateFile(string? saslOauthbearerAssertionJwtTemplateFile)

Parameters

saslOauthbearerAssertionJwtTemplateFile string

The path to the JWT template file.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslOauthbearerAssertionPrivateKeyFile(string?)

Sets the path to the client's private key (PEM) used for authentication when using the JWT assertion.

public KafkaClientsConfigurationBuilder WithSaslOauthbearerAssertionPrivateKeyFile(string? saslOauthbearerAssertionPrivateKeyFile)

Parameters

saslOauthbearerAssertionPrivateKeyFile string

The path to the client's private key (PEM) used for authentication when using the JWT assertion.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslOauthbearerAssertionPrivateKeyPassphrase(string?)

Sets the private key passphrase for sasl.oauthbearer.assertion.private.key.file or sasl.oauthbearer.assertion.private.key.pem.

public KafkaClientsConfigurationBuilder WithSaslOauthbearerAssertionPrivateKeyPassphrase(string? saslOauthbearerAssertionPrivateKeyPassphrase)

Parameters

saslOauthbearerAssertionPrivateKeyPassphrase string

The private key passphrase for sasl.oauthbearer.assertion.private.key.file or sasl.oauthbearer.assertion.private.key.pem.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslOauthbearerAssertionPrivateKeyPem(string?)

Sets the client's private key (PEM) used for authentication when using the JWT assertion.

public KafkaClientsConfigurationBuilder WithSaslOauthbearerAssertionPrivateKeyPem(string? saslOauthbearerAssertionPrivateKeyPem)

Parameters

saslOauthbearerAssertionPrivateKeyPem string

The client's private key (PEM) used for authentication when using the JWT assertion.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslOauthbearerClientId(string?)

Sets the public identifier for the application. Must be unique across all clients that the authorization server handles. Only used when SaslOauthbearerMethod is set to Confluent.Kafka.SaslOauthbearerMethod.Oidc.

public KafkaClientsConfigurationBuilder WithSaslOauthbearerClientId(string? saslOauthbearerClientId)

Parameters

saslOauthbearerClientId string

The public identifier for the application.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslOauthbearerClientSecret(string?)

Sets the client secret only known to the application and the authorization server. This should be a sufficiently random string that is not guessable. Only used when SaslOauthbearerMethod is set to Confluent.Kafka.SaslOauthbearerMethod.Oidc.

public KafkaClientsConfigurationBuilder WithSaslOauthbearerClientSecret(string? saslOauthbearerClientSecret)

Parameters

saslOauthbearerClientSecret string

The client secret only known to the application and the authorization server.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslOauthbearerConfig(string?)

Sets the SASL/OAUTHBEARER configuration. The format is implementation-dependent and must be parsed accordingly. The default unsecured token implementation (see https://tools.ietf.org/html/rfc7515#appendix-A.5) recognizes space-separated name=value pairs with valid names including principalClaimName, principal, scopeClaimName, scope, and lifeSeconds. The default value for principalClaimName is "sub", the default value for scopeClaimName is "scope", and the default value for lifeSeconds is 3600. The scope value is CSV format with the default value being no/empty scope. For example: principalClaimName=azp principal=admin scopeClaimName=roles scope=role1,role2 lifeSeconds=600. In addition, SASL extensions can be communicated to the broker via extension_NAME=value. For example: principal=admin extension_traceId=123.

public KafkaClientsConfigurationBuilder WithSaslOauthbearerConfig(string? saslOauthbearerConfig)

Parameters

saslOauthbearerConfig string

The SASL/OAUTHBEARER configuration.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslOauthbearerExtensions(string?)

Sets the additional information to be provided to the broker as a comma-separated list of key=value pairs (e.g. supportFeatureX=true,organizationId=sales-emea). Only used when SaslOauthbearerMethod is set to Confluent.Kafka.SaslOauthbearerMethod.Oidc.

public KafkaClientsConfigurationBuilder WithSaslOauthbearerExtensions(string? saslOauthbearerExtensions)

Parameters

saslOauthbearerExtensions string

The additional information to be provided to the broker as a comma-separated list of key=value pairs.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslOauthbearerGrantType(SaslOauthbearerGrantType?)

Sets the OAuth grant type to use when communicating with the identity provider.

public KafkaClientsConfigurationBuilder WithSaslOauthbearerGrantType(SaslOauthbearerGrantType? saslOauthbearerGrantType)

Parameters

saslOauthbearerGrantType SaslOauthbearerGrantType?

The OAuth grant type to use when communicating with the identity provider.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslOauthbearerMetadataAuthenticationType(SaslOauthbearerMetadataAuthenticationType?)

Sets the type of metadata-based authentication to use for OAUTHBEARER/OIDC azure_imds authenticates using the Azure IMDS endpoint. Sets a default value for sasl.oauthbearer.token.endpoint.url if missing. Configuration values specific of chosen authentication type can be passed through sasl.oauthbearer.config.

public KafkaClientsConfigurationBuilder WithSaslOauthbearerMetadataAuthenticationType(SaslOauthbearerMetadataAuthenticationType? saslOauthbearerMetadataAuthenticationType)

Parameters

saslOauthbearerMetadataAuthenticationType SaslOauthbearerMetadataAuthenticationType?

The type of metadata-based authentication to use for OAUTHBEARER/OIDC.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslOauthbearerMethod(SaslOauthbearerMethod?)

Sets the login method to be used. If set to Confluent.Kafka.SaslOauthbearerMethod.Oidc, the following properties must also be be specified: SaslOauthbearerClientId, SaslOauthbearerClientSecret, and SaslOauthbearerTokenEndpointUrl.

public KafkaClientsConfigurationBuilder WithSaslOauthbearerMethod(SaslOauthbearerMethod? saslOauthbearerMethod)

Parameters

saslOauthbearerMethod SaslOauthbearerMethod?

The login method to be used.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslOauthbearerScope(string?)

Sets the scope of the access request to the broker. Only used when SaslOauthbearerMethod is set to Confluent.Kafka.SaslOauthbearerMethod.Oidc.

public KafkaClientsConfigurationBuilder WithSaslOauthbearerScope(string? saslOauthbearerScope)

Parameters

saslOauthbearerScope string

The scope of the access request to the broker.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslOauthbearerTokenEndpointUrl(string?)

Sets the OAuth/OIDC issuer token endpoint HTTP(S) URI used to retrieve the token. Only used when SaslOauthbearerMethod is set to Confluent.Kafka.SaslOauthbearerMethod.Oidc.

public KafkaClientsConfigurationBuilder WithSaslOauthbearerTokenEndpointUrl(string? saslOauthbearerTokenEndpointUrl)

Parameters

saslOauthbearerTokenEndpointUrl string

The OAuth/OIDC issuer token endpoint HTTP(S) URI used to retrieve the token.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslPassword(string?)

Sets the SASL password to use with the PLAIN and SASL-SCRAM-.. mechanisms.

public KafkaClientsConfigurationBuilder WithSaslPassword(string? saslPassword)

Parameters

saslPassword string

The SASL password to use with the PLAIN and SASL-SCRAM-.. mechanisms.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSaslUsername(string?)

Sets the SASL username to use with the PLAIN and SASL-SCRAM-.. mechanisms.

public KafkaClientsConfigurationBuilder WithSaslUsername(string? saslUsername)

Parameters

saslUsername string

The SASL username to use with the PLAIN and SASL-SCRAM-.. mechanisms.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSecurityProtocol(SecurityProtocol?)

Sets the protocol to be used to communicate with the brokers.

public KafkaClientsConfigurationBuilder WithSecurityProtocol(SecurityProtocol? securityProtocol)

Parameters

securityProtocol SecurityProtocol?

The protocol to be used to communicate with the brokers.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSocketConnectionSetupTimeoutMs(int?)

Sets the maximum time (in milliseconds) allowed for the setup of the broker connection (TCP connection setup and SSL/SASL handshake). The connection to the broker will be closed and retried, if the timeout elapses before it is fully functional.

public KafkaClientsConfigurationBuilder WithSocketConnectionSetupTimeoutMs(int? socketConnectionSetupTimeoutMs)

Parameters

socketConnectionSetupTimeoutMs int?

The maximum time allowed for the setup of the broker connection.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSocketMaxFails(int?)

Sets the maximum number of send failures (e.g. timed out requests) before disconnecting. Disable with 0.
Warning: It is highly recommended to leave this setting at its default value of 1 to avoid the client and broker to become desynchronized in case of request timeouts.
Note: The connection is automatically re-established.

public KafkaClientsConfigurationBuilder WithSocketMaxFails(int? socketMaxFails)

Parameters

socketMaxFails int?

The maximum number of send failures before disconnecting.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSocketReceiveBufferBytes(int?)

Sets the socket receive buffer size. The system default is used if 0.

public KafkaClientsConfigurationBuilder WithSocketReceiveBufferBytes(int? socketReceiveBufferBytes)

Parameters

socketReceiveBufferBytes int?

The socket receive buffer size.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSocketSendBufferBytes(int?)

Sets the socket send buffer size. The system default is used if 0.

public KafkaClientsConfigurationBuilder WithSocketSendBufferBytes(int? socketSendBufferBytes)

Parameters

socketSendBufferBytes int?

The socket send buffer size.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSocketTimeoutMs(int?)

Sets the default timeout (in milliseconds) for network requests.

public KafkaClientsConfigurationBuilder WithSocketTimeoutMs(int? socketTimeoutMs)

Parameters

socketTimeoutMs int?

The default timeout for network requests.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSslCaCertificateStores(string?)

Sets a comma-separated list of Windows certificate stores to load CA certificates from. The certificates will be loaded in the same order as stores are specified. If no certificates can be loaded from any of the specified stores an error is logged and the OpenSSL library's default CA location is used instead. Store names are typically one or more of: MY, Root, Trust, CA.

public KafkaClientsConfigurationBuilder WithSslCaCertificateStores(string? sslCaCertificateStores)

Parameters

sslCaCertificateStores string

A comma-separated list of Windows certificate stores to load CA certificates from.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSslCaLocation(string?)

Sets the file or directory path to the CA certificate(s) for verifying the broker's key. Defaults: On Windows the system's CA certificates are automatically looked up in the Windows Root certificate store. On Mac OSX this configuration defaults to probe. It is recommended to install openssl using Homebrew, to provide CA certificates. On Linux install the distribution's ca-certificates package. If OpenSSL is statically linked or SslCaLocation is set to probe a list of standard paths will be probed and the first one found will be used as the default CA certificate location path. If OpenSSL is dynamically linked the OpenSSL library's default path will be used (see OPENSSLDIR in openssl version -a).

public KafkaClientsConfigurationBuilder WithSslCaLocation(string? sslCaLocation)

Parameters

sslCaLocation string

The file or directory path to the CA certificate(s) for verifying the broker's key.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSslCaPem(string?)

Sets the CA certificate string (in PEM format) for verifying the broker's key.

public KafkaClientsConfigurationBuilder WithSslCaPem(string? sslCaPem)

Parameters

sslCaPem string

The CA certificate string (in PEM format).

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSslCertificateLocation(string?)

Sets the path to the client's public key (PEM) used for the authentication.

public KafkaClientsConfigurationBuilder WithSslCertificateLocation(string? sslCertificateLocation)

Parameters

sslCertificateLocation string

The path to the client's public key (PEM).

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSslCertificatePem(string?)

Sets the client's public key string (in PEM format) used for the authentication.

public KafkaClientsConfigurationBuilder WithSslCertificatePem(string? sslCertificatePem)

Parameters

sslCertificatePem string

The client's public key string (in PEM format).

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSslCipherSuites(string?)

Sets the SSL cipher suites.

public KafkaClientsConfigurationBuilder WithSslCipherSuites(string? sslCipherSuites)

Parameters

sslCipherSuites string

The SSL cipher suites.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSslCrlLocation(string?)

Sets the path to the certificate revocation list (CRL) for verifying broker's certificate validity.

public KafkaClientsConfigurationBuilder WithSslCrlLocation(string? sslCrlLocation)

Parameters

sslCrlLocation string

The path to the certificate revocation list (CRL).

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSslCurvesList(string?)

Sets the supported SSL curves.

public KafkaClientsConfigurationBuilder WithSslCurvesList(string? sslCurvesList)

Parameters

sslCurvesList string

The supported SSL curves.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSslEndpointIdentificationAlgorithm(SslEndpointIdentificationAlgorithm?)

Sets the endpoint identification algorithm to be used to validate the broker hostname using the certificate. OpenSSL >= 1.0.2 required.

public KafkaClientsConfigurationBuilder WithSslEndpointIdentificationAlgorithm(SslEndpointIdentificationAlgorithm? sslEndpointIdentificationAlgorithm)

Parameters

sslEndpointIdentificationAlgorithm SslEndpointIdentificationAlgorithm?

The endpoint identification algorithm to be used to validate the broker hostname.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSslEngineId(string?)

Sets the OpenSSL engine id (the name used for loading engine).

public KafkaClientsConfigurationBuilder WithSslEngineId(string? sslEngineId)

Parameters

sslEngineId string

The OpenSSL engine id.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSslEngineLocation(string?)

Sets the path to the OpenSSL engine library. OpenSSL >= 1.1.0 required.

public KafkaClientsConfigurationBuilder WithSslEngineLocation(string? sslEngineLocation)

Parameters

sslEngineLocation string

The path to the OpenSSL engine library.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSslKeyLocation(string?)

Sets the path to the client's private key (PEM) used for the authentication.

public KafkaClientsConfigurationBuilder WithSslKeyLocation(string? sslKeyLocation)

Parameters

sslKeyLocation string

The path to the client's private key (PEM).

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSslKeyPassword(string?)

Sets the private key passphrase.

public KafkaClientsConfigurationBuilder WithSslKeyPassword(string? sslKeyPassword)

Parameters

sslKeyPassword string

The private key passphrase.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSslKeyPem(string?)

Sets the client's private key string (in PEM format) used for the authentication.

public KafkaClientsConfigurationBuilder WithSslKeyPem(string? sslKeyPem)

Parameters

sslKeyPem string

The client's private key string (in PEM format).

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSslKeystoreLocation(string?)

Sets the path to the client's keystore (PKCS#12) used for the authentication.

public KafkaClientsConfigurationBuilder WithSslKeystoreLocation(string? sslKeystoreLocation)

Parameters

sslKeystoreLocation string

The path to the client's keystore (PKCS#12).

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSslKeystorePassword(string?)

Sets the client's keystore (PKCS#12) password.

public KafkaClientsConfigurationBuilder WithSslKeystorePassword(string? sslKeystorePassword)

Parameters

sslKeystorePassword string

The client's keystore (PKCS#12) password.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSslProviders(string?)

Sets the comma-separated list of OpenSSL 3.0.x implementation providers.

public KafkaClientsConfigurationBuilder WithSslProviders(string? sslProviders)

Parameters

sslProviders string

The comma-separated list of OpenSSL 3.0.x implementation providers.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithSslSigalgsList(string?)

Sets the supported SSL signature algorithms.

public KafkaClientsConfigurationBuilder WithSslSigalgsList(string? sslSigalgsList)

Parameters

sslSigalgsList string

The supported SSL signature algorithms.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithStatisticsIntervalMs(int?)

Sets the statistics emit interval (in milliseconds). The granularity is 1000ms. A value of 0 disables statistics.

public KafkaClientsConfigurationBuilder WithStatisticsIntervalMs(int? statisticsIntervalMs)

Parameters

statisticsIntervalMs int?

The statistics emit interval.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithTopicBlacklist(string?)

Sets a comma-separated list of regular expressions for matching topic names that should be ignored in broker metadata information as if the topics did not exist.

public KafkaClientsConfigurationBuilder WithTopicBlacklist(string? topicBlacklist)

Parameters

topicBlacklist string

The comma-separated list of regular expressions for the topic black list.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithTopicMetadataPropagationMaxMs(int?)

Sets the delay (in milliseconds) to be applied before marking a topic as non-existent. The maximum propagation time is calculated from the time the topic is first referenced in the client.

public KafkaClientsConfigurationBuilder WithTopicMetadataPropagationMaxMs(int? topicMetadataPropagationMaxMs)

Parameters

topicMetadataPropagationMaxMs int?

The delay to be observed before marking a topic as non-existent.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithTopicMetadataRefreshFastIntervalMs(int?)

Sets the refresh interval (in milliseconds) to be applied instead of the TopicMetadataRefreshIntervalMs when a topic loses its leader and a new metadata request will be enqueued. This initial interval will be exponentially increased until the topic metadata has been refreshed. This is used to recover quickly from transitioning leader brokers.

public KafkaClientsConfigurationBuilder WithTopicMetadataRefreshFastIntervalMs(int? topicMetadataRefreshFastIntervalMs)

Parameters

topicMetadataRefreshFastIntervalMs int?

The refresh interval.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.

WithTopicMetadataRefreshIntervalMs(int?)

Sets the interval (in milliseconds) at which the topic and broker metadata is refreshed in order to proactively discover any new brokers, topics, partitions or partition leader changes. Use -1 to disable the intervalled refresh (not recommended). If there are no locally referenced topics (no topic objects created, no messages produced, no subscription or no assignment) then only the broker list will be refreshed every interval but no more often than every 10s.

public KafkaClientsConfigurationBuilder WithTopicMetadataRefreshIntervalMs(int? topicMetadataRefreshIntervalMs)

Parameters

topicMetadataRefreshIntervalMs int?

The interval at which the topic and broker metadata is refreshed.

Returns

KafkaClientsConfigurationBuilder

The KafkaClientsConfigurationBuilder so that additional calls can be chained.