[
https://issues.apache.org/jira/browse/CAMEL-14919?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17084741#comment-17084741
]
Claus Ibsen commented on CAMEL-14919:
-------------------------------------
You can specify a custom exception handler in the endpoint uri, via the
exceptionHandler option. See the kafka docs at:
https://camel.apache.org/components/2.x/kafka-component.html
Another workaround create the consumer via the endpoint (not use the template),
and then use its API to receive and in case of exception you can see that on
the exchange getException method.
> DefaultCocsumerTemplate is not allowing to set the custom ExceptionHandler
> --------------------------------------------------------------------------
>
> Key: CAMEL-14919
> URL: https://issues.apache.org/jira/browse/CAMEL-14919
> Project: Camel
> Issue Type: Improvement
> Components: camel-kafka
> Affects Versions: 2.25.0
> Reporter: Sanojit Nayak
> Priority: Minor
> Fix For: 3.x
>
>
> We are using org.apache.camel.DefaultConsumerTemplate.receive(String
> endpointUri, long timeout) to consume the messages from a Kafka topic.
> We are facing an issue, If we interrupt the current thread it is logging the
> exception by using “ org.apache.camel.util.CamelLogger”.
> Therefore we don’t get any handle to set the custom exception handler for the
> Default Consumer created by ConsumerTemplate.
> Exception Log :
> org.apache.camel.util.CamelLogger log
> WARNING: Interrupted while consuming RequestTopic-Thread 0 from kafka topic.
> Caused by: [org.apache.kafka.common.errors.InterruptException -
> java.lang.InterruptedException]
> org.apache.kafka.common.errors.InterruptException:
> java.lang.InterruptedException
--
This message was sent by Atlassian Jira
(v8.3.4#803005)