Class KafkaDeadLetterOptions
Configuration options for Kafka dead letter queue management.
public sealed class KafkaDeadLetterOptions
- Inheritance
-
KafkaDeadLetterOptions
- Inherited Members
- Extension Methods
Remarks
Dead letter topics follow the naming convention {original-topic}.dead-letter by default.
A dedicated consumer group is used for DLQ processing, separate from the main consumer group.
Properties
AutoCreateTopics
Gets or sets a value indicating whether to automatically create DLQ topics if they don't exist.
public bool AutoCreateTopics { get; set; }
Property Value
ConsumeTimeout
Gets or sets the timeout for consume operations from the DLQ topic.
public TimeSpan ConsumeTimeout { get; set; }
Property Value
- TimeSpan
The consume timeout. Defaults to 5 seconds.
ConsumerGroupId
Gets or sets the consumer group ID used for consuming from DLQ topics.
public string ConsumerGroupId { get; set; }
Property Value
- string
The DLQ consumer group ID. Defaults to
dlq-processor.
IncludeStackTrace
Gets or sets a value indicating whether to include exception stack traces in DLQ message headers.
public bool IncludeStackTrace { get; set; }
Property Value
MaxDeliveryAttempts
Gets or sets the maximum number of delivery attempts before a message is dead lettered.
[Range(1, 2147483647)]
public int MaxDeliveryAttempts { get; set; }
Property Value
- int
The maximum delivery attempts. Defaults to 5.
MessageRetentionPeriod
Gets or sets the retention period for messages in the DLQ topic (mapped to Kafka topic config).
public TimeSpan MessageRetentionPeriod { get; set; }
Property Value
- TimeSpan
The DLQ message retention period. Defaults to 14 days.
ProduceTimeout
Gets or sets the timeout for produce operations to the DLQ topic.
public TimeSpan ProduceTimeout { get; set; }
Property Value
- TimeSpan
The produce timeout. Defaults to 30 seconds.
TopicPartitions
Gets or sets the number of partitions for auto-created DLQ topics.
public int TopicPartitions { get; set; }
Property Value
- int
The number of partitions. Defaults to 1.
TopicReplicationFactor
Gets or sets the replication factor for auto-created DLQ topics.
public short TopicReplicationFactor { get; set; }
Property Value
- short
The replication factor. Defaults to -1 (broker default).
TopicSuffix
Gets or sets the suffix appended to the original topic name to form the DLQ topic name.
[Required]
public string TopicSuffix { get; set; }
Property Value
- string
The DLQ topic suffix. Defaults to
.dead-letter.
Methods
GetDeadLetterTopicName(string)
Builds the dead letter topic name for the specified source topic.
public string GetDeadLetterTopicName(string sourceTopic)
Parameters
sourceTopicstringThe original topic name.
Returns
- string
The dead letter topic name.