Class KafkaOptions
Configuration options for Kafka integration.
public sealed class KafkaOptions
- Inheritance
-
KafkaOptions
- Inherited Members
- Extension Methods
Remarks
This type intentionally exposes more than ten properties: it mirrors the native configuration surface of the underlying Kafka client (broker, consumer-group, offset, security, and payload settings) so consumers can tune the transport without reaching for a second options object. The property count reflects the provider's own configuration breadth rather than a design that should be split into narrower types.
Properties
AdditionalConfig
Gets additional Kafka consumer configuration properties.
public Dictionary<string, string> AdditionalConfig { get; }
Property Value
- Dictionary<string, string>
Additional Kafka consumer configuration properties.
BootstrapServers
Gets or sets the Kafka bootstrap servers (comma-separated list).
[Required]
public string BootstrapServers { get; set; }
Property Value
- string
The Kafka bootstrap servers (comma-separated list).
Consumer
Gets or sets the consumer tuning options for batching, offset management, and session timeouts.
public KafkaConsumerTuningOptions Consumer { get; set; }
Property Value
- KafkaConsumerTuningOptions
The consumer tuning options.
ConsumerGroup
Gets or sets the consumer group ID.
public string ConsumerGroup { get; set; }
Property Value
- string
The consumer group ID.
GroupProtocol
Gets or sets the consumer group protocol. Default is classic.
public GroupProtocol? GroupProtocol { get; set; }
Property Value
- GroupProtocol?
The consumer group protocol (classic or consumer). The consumer protocol enables KIP-848 behavior.
RequireTls
Gets or sets a value indicating whether broker connections must be encrypted.
public bool RequireTls { get; set; }
Property Value
- bool
true to refuse to build any Kafka client whose security protocol does not carry TLS; false to permit an unencrypted connection. Default is true.
Remarks
The refusal happens when the client is built, so a misconfigured deployment fails where it is wired rather than at the first message.
Setting this to false permits credentials and message payloads to travel in the clear. It exists for local brokers and test fixtures, not for anything holding real data.
SecurityProtocol
Gets or sets the security protocol used for broker connections.
public SecurityProtocol? SecurityProtocol { get; set; }
Property Value
- SecurityProtocol?
The security protocol, or null to take it from the
security.protocolkey in AdditionalConfig. When neither supplies one the connection is plaintext.
Remarks
Setting this property and the raw security.protocol key to different values is refused
rather than resolved: a silent winner between two spellings of a security control is how an
intended TLS posture becomes a plaintext connection. Set one or the other.
A protocol that does not carry TLS is refused entirely while RequireTls is set.
Topic
Gets or sets the Kafka topic name.
public string Topic { get; set; }
Property Value
- string
The Kafka topic name.