You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Prathamesh (Jira)" <ji...@apache.org> on 2021/08/03 07:12:00 UTC
[jira] [Updated] (CAMEL-16836) spring boot camel kafka redelivery
policy and dead letter handler not working
[ https://issues.apache.org/jira/browse/CAMEL-16836?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Prathamesh updated CAMEL-16836:
-------------------------------
Description:
I am trying to consume message from kafka and invoke mailService to trigger email. Below is the code snippet for the same
@Component
public class KafkaReceiverRoute extends RouteBuilder {
@Override
public void configure() throws Exception {
errorHandler(deadLetterChannel("kafka:{{emailDeadLetter}}")
.maximumRedeliveries(3)
.loggingLevel(LoggingLevel.WARN));
from("kafka:{{email}}") .unmarshal()
.json(JsonLibrary.Jackson, EmailRequest.class)
.to("bean:mailService?method=sendMailAndCommitTokafka");
}
}
I am using spring boot 2.5.3 and java 1.8 with below camel dependencies
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-kafka-starter</artifactId>
<version>3.8.0</version> </dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-jackson-starter</artifactId>
<version>3.8.0</version>
</dependency>
But when exception occurs in sendMailAndCommitTokafka method and message processing fails, camel is neither retrying the message as per redelivery policy nor the message is getting added in dead letter topic as per configured dead letter channel error handler.
was:
I am to trying consume message from kafka and invoke mailService to trigger email. Below is the code snippet for the same
@Component
public class KafkaReceiverRoute extends RouteBuilder {
@Override
public void configure() throws Exception {
errorHandler(deadLetterChannel("kafka:{{emailDeadLetter}}")
.maximumRedeliveries(3)
.loggingLevel(LoggingLevel.WARN));
from("kafka:{{email}}") .unmarshal()
.json(JsonLibrary.Jackson, EmailRequest.class)
.to("bean:mailService?method=sendMailAndCommitTokafka");
}
}
I am using spring boot 2.5.3 and java 1.8 with below camel dependencies
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-kafka-starter</artifactId>
<version>3.8.0</version> </dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-jackson-starter</artifactId>
<version>3.8.0</version>
</dependency>
But when exception occurs in sendMailAndCommitTokafka method and message processing fails, camel is neither retrying the message as per redelivery policy nor the message is getting added in dead letter topic as per configured dead letter channel error handler.
> spring boot camel kafka redelivery policy and dead letter handler not working
> -----------------------------------------------------------------------------
>
> Key: CAMEL-16836
> URL: https://issues.apache.org/jira/browse/CAMEL-16836
> Project: Camel
> Issue Type: Bug
> Reporter: Prathamesh
> Priority: Major
>
> I am trying to consume message from kafka and invoke mailService to trigger email. Below is the code snippet for the same
> @Component
> public class KafkaReceiverRoute extends RouteBuilder {
> @Override
> public void configure() throws Exception {
> errorHandler(deadLetterChannel("kafka:{{emailDeadLetter}}")
> .maximumRedeliveries(3)
> .loggingLevel(LoggingLevel.WARN));
> from("kafka:{{email}}") .unmarshal()
> .json(JsonLibrary.Jackson, EmailRequest.class)
> .to("bean:mailService?method=sendMailAndCommitTokafka");
> }
> }
>
> I am using spring boot 2.5.3 and java 1.8 with below camel dependencies
> <dependency>
> <groupId>org.apache.camel.springboot</groupId>
> <artifactId>camel-kafka-starter</artifactId>
> <version>3.8.0</version> </dependency>
> <dependency>
> <groupId>org.apache.camel.springboot</groupId>
> <artifactId>camel-jackson-starter</artifactId>
> <version>3.8.0</version>
> </dependency>
>
> But when exception occurs in sendMailAndCommitTokafka method and message processing fails, camel is neither retrying the message as per redelivery policy nor the message is getting added in dead letter topic as per configured dead letter channel error handler.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)