-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce capability for publishing error Records to Dead letter topic #106
Introduce capability for publishing error Records to Dead letter topic #106
Conversation
Signed-off-by: “Nithin <nithin.pankaj@walmartlabs.com>
e109055
to
17d7499
Compare
KafkaTemplate<String, String> deadLetterPublisherTemplate = | ||
new KafkaTemplate<>( | ||
kafkaProducerConfig.eventProducerFactory(kafkaProperties.getFailedMessageListener())); | ||
|
||
// Set the exclusive dead letter topic | ||
deadLetterPublisherTemplate.setDefaultTopic( | ||
kafkaProperties.getFailedMessageListener().getTopic()); | ||
deadLetterPublishingRecoverer = | ||
new DeadLetterPublishingRecoverer( | ||
deadLetterPublisherTemplate, | ||
(cr, e) -> | ||
new TopicPartition( | ||
kafkaProperties.getFailedMessageListener().getTopic(), cr.partition())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] a method can be extracted for these lines as only listener is different and rest is same in both scenarios
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Done.
@@ -20,7 +20,8 @@ | |||
public class KafkaProperties { | |||
|
|||
private List<Consumer> integrationPoints; | |||
private Producer eventListener; | |||
private EventProducer eventListener; | |||
private Producer failedMessageListener; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add the application.yml change for this in application.template file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
…ge consumption Signed-off-by: “Nithin <nithin.pankaj@walmartlabs.com>
Signed-off-by: “Nithin <nithin.pankaj@walmartlabs.com>
Signed-off-by: “Nithin <nithin.pankaj@walmartlabs.com>
Signed-off-by: “Nithin <nithin.pankaj@walmartlabs.com>
Signed-off-by: “Nithin <nithin.pankaj@walmartlabs.com>
17d7499
to
cfda8e5
Compare
cfda8e5
to
2183d13
Compare
Signed-off-by: “Nithin <nithin.pankaj@walmartlabs.com>
2183d13
to
f08ca4d
Compare
This PR contains the changes for publishing failed consumer Records polled from the Integration topic(s) to a configured error Event listener Topic.
The changes would effectively allow the Connector to publish the Error record to a topic based on the following criteria :-
listenToFailedMessages
set as true, the failed message will be published back to Event listener topic (this is the current behaviour).listenToFailedMessages
is set to true as well as a dedicated Dead letter topic is configured, the dead letter topic will take priority and record will be dispatched to it.