Change DEAD LETTER topic default retention time

Viewed 67

We have enabled dead letter queue for our JDBC sink connectors. Out default retention policy is 7 days but for DLQ we want to reduce it to 1 day. Following are the properties for DLQ in our Sink connector.

   'errors.tolerance'='all',
   'errors.deadletterqueue.topic.name' = 'error_topic',
   'errors.deadletterqueue.topic.replication.factor'= -1,
   'errors.log.include.messages' = true,
   'errors.log.enable' = true,
   'errors.deadletterqueue.context.headers.enable' = true

Is there a property using which we can change the retention time? We have tried using following properties but did not work as expected.

'topic.creation.default.retention.ms'='3000',
'admin.topic.creation.default.retention.ms'='3000',
'admin.retention.ms' = '3000',
'admin.topic.retention.ms' = '3000',
'admin.topic.creation.retention.ms' = '3000',
'error.topic.creation.default.retention.ms'='3000',
'error.deadletterqueue.topic.creation.default.retention.ms'='3000',
'admin.topic.creation.default.retention.ms' = 3000,
1 Answers

Create your DLQ topics ahead of time with the properties you'll need. Otherwise, you'll need to use kafka-topics --alter command since modifying any configs in Connect would only apply to brand new topics, if you the topic configs outside of partitions and replication could be set

Related