Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
3.21.0
-
None
-
- Rocky Linux 8.7
- Open JDK 11.0.8
- Camel 3.21.0
- Spring Boot 2.7.14
- Strimzi Kafka 0.28.0/3.0.0
-
Unknown
Description
Reproducing (intermittent):
- Configure camel kafka consumer with following:
- autoCommitEnable = false
- allowManualCommit = true
- autoOffsetReset = earliest
- maxPollRecords = 1
- breakOnFirstError = true
- Produce a series of records to kafka record to both partitions.
- Throw an exception that is unhandled
- commit the offset in the onException block
Expected behavior:
- Application should consume the record 1 more time, then move on to the next offset in the partition
Actual behavior:
- Application will often work. Occasionally will use the offset from another partition and assign that to the partition where the record failed. This can then result in the consumer replaying messages instead of moving forward.
I put together a sample that can recreate the error. However, given its intermittent nature it may not fail on each run. I have included the logs from 3 different runs on my laptop from this test. Two of them show the error occurring. One of the them has a successful run. I have also provided more details in the README.
This seems related to other issues with how Camel processes the breakOnFirstError attribute.
Attachments
Attachments
Issue Links
- causes
-
CAMEL-20089 camel-kafka: make breakOnFirstError more flexible
- Resolved
- is related to
-
CAMEL-14935 KafkaConsumer commits old offset values in a failure scenario causing message replays and offset reset error
- Resolved
-
CAMEL-17925 camel-kafka: "breakOnFirstError" option is not respected
- Resolved
-
CAMEL-18350 camel-kafka: enabling "breakOnFirstError" causes camel to reconsume all records on error
- Resolved
-
CAMEL-18760 camel-kafka - Issue using ThrottlingExceptionRoutePolicy with Kafka consumer
- Resolved
-
CAMEL-19894 camel-kafka: enabling "breakOnFirstError" causes to skip records on exception
- Resolved
- relates to
-
CAMEL-20235 camel-kafka: consolidate commit management behavior between component and endpoint
- Resolved
- links to