You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2023/01/04 09:30:00 UTC

[jira] [Commented] (CAMEL-18759) camel-kafka - When Kafka pausable consumer is resumed, it reads all the messages from the earliest offset

    [ https://issues.apache.org/jira/browse/CAMEL-18759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17654364#comment-17654364 ] 

Claus Ibsen commented on CAMEL-18759:
-------------------------------------

If you have time try with 3.20.0 / 3.20.1. 

> camel-kafka - When Kafka pausable consumer is resumed, it reads all the messages from the earliest offset
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-18759
>                 URL: https://issues.apache.org/jira/browse/CAMEL-18759
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-kafka
>    Affects Versions: 3.18.3
>            Reporter: Lorenzo Benvenuti
>            Priority: Minor
>             Fix For: 3.21.0
>
>
> Hi,
> I'm trying to add the circuit breaker pattern to a Kafka consumer. In short, I want to suspend the consumer when an exception happens due to an outage in downstream systems and resume the consumer when downstream systems are up again. As a reference I used this example from the Camel documentation: https://camel.apache.org/components/3.18.x/eips/resume-strategies.html#_pausable_consumers_api (coming from this test: https://github.com/apache/camel/blob/2c01082032346753cc6621ab4530b0969f12bac7/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/pause/KafkaPausableConsumerCircuitBreakerIT.java)
> However, I noticed that every time the consumer is resumed it starts reading the messages from the earliest offset, and this causes a redelivery of all the messages stored in the partition; as far as I can tell it happens because {{KafkaConsumerListener#afterProcess}} invokes {{consumer.seekToBeginning}}.
> I've created a reproducer here: https://github.com/lorenzobenvenuti/camel-kafka-pausable-bug
> Thanks,
> lorenzo



--
This message was sent by Atlassian Jira
(v8.20.10#820010)