[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Camel Kafka Consumer KafkaException ignored


Sounds a bit like the chicken and egg, eg the kafka consumer needs to
create a valid exchange for Camel to start routing.
You can try to set the bridge error handler = true which should catch
internal errors and make a "fake" exchange for Camel to route and have
its error handler react.
But not all components has the option, but take a look and report back.

And if its still a problem then we can log a JIRA to see if we can
deal with exceptions from the deserializer and do something in
On Wed, Nov 14, 2018 at 10:24 PM Webster Homer
<webster.homer@xxxxxxxxxxxxxxxxxx> wrote:
> I have an application that uses Camel 2.21.1 and Kafka 1.1
> I had a bug where the deserializer for the consumer threw an exception when deserializing the message. I could see an exception in the log, but the consumer never handled the exception and the message was throwing an exception each time, forever. Why didn't camel see the exception so that the application code could commit that offset?
> This is my consumer endpoint
>                 @EndpointInject(uri = "kafka:{{deep.send.order.email}}?brokers={{deep.notify.kafka.server}}&groupId=orders-enrichment-grp&"+
>                         "autoCommitEnable=false&allowManualCommit=true&" +
>             "maxPollRecords={{deep.kafka.poll.count}}&" +
>                                                 "keyDeserializer=org.apache.kafka.common.serialization.StringDeserializer&" +
>                                                 "valueDeserializer=com.sial.notifications.kafka.utilities.MessageJSONFormatter")
> The problem was in the MessageJSONFormatter and I have fixed the problem. However, I expected that the exception be caught in Camel's kafka consumer and propagated to the global handler where the offset could be committed
> How do I address an issue like this in the future?

Claus Ibsen
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2