Hi,

I'm trying to define following scenario.
Imagine I have 3 messages in kafka topic and I start reading them with
camel route and processing of second message fails on exception. I would
like to start getting that second message until a (temporary) problem is
resolved. I would like to utilize auto commit if possible.

Reading the docs, I would expect following kafka: configuration would
achieve that:

autoCommitEnable=true
breakOnFirstError=true
allowManualCommit=false
kafkaManualCommitFactory=#class:org.apache.camel.component.kafka.consumer.DefaultKafkaManualCommitFactory

kafkaManualCommitFactory should change NoopCommitManager to
SyncCommitManager which positions the read offset in kafka to the failed
message once breakOnFirstError happens. Once the reading is restarted, I
should get the failed message again.

However, this is not what I'm observing, as all the polled messages are
committed. Debugging, I traced that to
https://github.com/apache/camel/blob/f141b63a266e5b180dec421bf3665ff808742ba6/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaFetchRecords.java#L405
where the commit of all messages happens despite the error.

Now my question is, whether my configuration wrong or I'm trying to use an
approach that does not make sense and I should use manual commit instead.

Thanks for answer.

Reply via email to