Class KafkaBuilder
Fluent builder for Kafka endpoint URIs.
public sealed class KafkaBuilder
Inheritance
Methods
AckMode(AckMode)
When the offset is committed: after the route (, default; a transactional
public KafkaBuilder AckMode(AckMode mode)
Acks(string)
Acknowledge level: None, Leader, All. Default "All".
public KafkaBuilder Acks(string acks)
AutoOffsetReset(string)
Auto offset reset: Latest, Earliest, Error.
public KafkaBuilder AutoOffsetReset(string reset)
Batching()
Batch mode (batching=true): the route gets the records as a List<IMessage>.
public KafkaBuilder Batching()
BatchingIntervalMs(IExpression)
Hard limit of a batch from an expression.
public KafkaBuilder BatchingIntervalMs(IExpression ms)
BatchingIntervalMs(int)
Hard limit of a batch in milliseconds from its first record (batchingIntervalMs). Batch mode only.
public KafkaBuilder BatchingIntervalMs(int ms)
BatchSize(IExpression)
Batch size from an expression.
public KafkaBuilder BatchSize(IExpression bytes)
Brokers(IExpression)
Bootstrap servers (comma-separated host:port). e.g. "broker1:9092,broker2:9092".
public KafkaBuilder Brokers(IExpression brokers)
Brokers(string)
Bootstrap servers (template string, supports ${...}). e.g. "broker1:9092,broker2:9092".
public KafkaBuilder Brokers(string brokers)
Compression(string)
Compression type: none, gzip, snappy, lz4, zstd.
public KafkaBuilder Compression(string type)
ConnectionFactory(IExpression)
Use a named connection factory registered in DI.
public KafkaBuilder ConnectionFactory(IExpression name)
ConnectionFactory(string)
Use a named connection factory registered in DI (template string, supports ${...}).
public KafkaBuilder ConnectionFactory(string name)
EnableIdempotence(bool)
Sets enableIdempotence: the broker does not write a retried send twice. Left unset, it follows acks: on
public KafkaBuilder EnableIdempotence(bool value = true)
GroupId(string)
Consumer group ID (template string, supports ${...}).
public KafkaBuilder GroupId(string groupId)
GroupInstanceId(IExpression)
Static group instance ID for cooperative rebalancing.
public KafkaBuilder GroupInstanceId(IExpression id)
GroupInstanceId(string)
Static group instance ID for cooperative rebalancing (template string, supports ${...}).
public KafkaBuilder GroupInstanceId(string id)
HeartbeatInterval(IExpression)
Heartbeat interval from an expression.
public KafkaBuilder HeartbeatInterval(IExpression ms)
HeartbeatInterval(int)
Heartbeat interval in milliseconds.
public KafkaBuilder HeartbeatInterval(int ms)
IsolationLevel(string)
Isolation level: ReadUncommitted, ReadCommitted.
public KafkaBuilder IsolationLevel(string level)
Key(string)
Message key for partitioning (template string, supports ${...}).
public KafkaBuilder Key(string key)
MaxBatchMessages(IExpression)
Largest number of records in a batch from an expression.
public KafkaBuilder MaxBatchMessages(IExpression max)
MaxBatchMessages(int)
Largest number of records in a batch (maxBatchMessages, default 500). Batch mode only.
public KafkaBuilder MaxBatchMessages(int max)
MaxPollInterval(IExpression)
Max poll interval from an expression.
public KafkaBuilder MaxPollInterval(IExpression ms)
MessageTimeout(IExpression)
Message timeout from an expression.
public KafkaBuilder MessageTimeout(IExpression ms)
MessageTimeout(int)
Message delivery timeout in milliseconds.
public KafkaBuilder MessageTimeout(int ms)
PartitionAssignmentStrategy(string)
Partition assignment strategy.
public KafkaBuilder PartitionAssignmentStrategy(string strategy)
PartitionKey(int)
Producer: the partition every record goes to (partitionKey, Apache Camel's name); it takes precedence over
public KafkaBuilder PartitionKey(int partition)
PartitionNumber(int)
Consumer: read this one partition (partitionNumber) instead of joining the group's assignment.
public KafkaBuilder PartitionNumber(int partition)
PollTimeout(IExpression)
Poll timeout from an expression.
public KafkaBuilder PollTimeout(IExpression ms)
PollTimeout(int)
Poll timeout in milliseconds, default 1000; in batch mode the idle timeout of a batch.
public KafkaBuilder PollTimeout(int ms)
RecordMetadata()
Include record metadata (partition, offset) in the exchange after produce.
public KafkaBuilder RecordMetadata()
Sasl(string, IExpression, IExpression)
SASL authentication: mechanism + credentials.
public KafkaBuilder Sasl(string mechanism, IExpression username, IExpression password)
SecurityProtocol(string)
Security protocol: Plaintext, Ssl, SaslPlaintext, SaslSsl.
public KafkaBuilder SecurityProtocol(string protocol)
SeekTo(string)
Seek each assigned partition once to a position: "beginning" or "end".
public KafkaBuilder SeekTo(string position)
SessionTimeout(IExpression)
Session timeout from an expression.
public KafkaBuilder SessionTimeout(IExpression ms)
SslCa(string)
Path to CA certificate file for SSL (template string, supports ${...}).
public KafkaBuilder SslCa(string path)
SslCert(IExpression, IExpression?, IExpression?)
Client certificate for mutual TLS.
public KafkaBuilder SslCert(IExpression certPath, IExpression? keyPath = null, IExpression? keyPassword = null)
SslCert(string, string?, string?)
Client certificate for mutual TLS (template strings, support ${...}).
public KafkaBuilder SslCert(string certPath, string? keyPath = null, string? keyPassword = null)
SslVerifyHostname(bool)
Whether the broker's hostname is verified against its certificate (sslEndpointIdentificationAlgorithm
public KafkaBuilder SslVerifyHostname(bool verify = true)
Transacted()
The send joins the enclosing .Transacted() block (deferred until the database commits) and refuses to run
public KafkaBuilder Transacted()
Transacted(bool)
Sets transacted explicitly. false sends at once even inside a .Transacted() block, outside its
public KafkaBuilder Transacted(bool value)
TransactionalIdPrefix(string)
Sets transactionalIdPrefix: the producer uses Kafka transactions. The sends it defers in a
public KafkaBuilder TransactionalIdPrefix(string prefix)