You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Otavio Rodolfo Piske (Jira)" <ji...@apache.org> on 2022/11/24 10:27:00 UTC
[jira] [Resolved] (CAMEL-18717) camel-kafka: investigate offset not increasing
[ https://issues.apache.org/jira/browse/CAMEL-18717?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Otavio Rodolfo Piske resolved CAMEL-18717.
------------------------------------------
Fix Version/s: 3.18.4
Resolution: Fixed
> camel-kafka: investigate offset not increasing
> ----------------------------------------------
>
> Key: CAMEL-18717
> URL: https://issues.apache.org/jira/browse/CAMEL-18717
> Project: Camel
> Issue Type: Bug
> Components: camel-kafka
> Affects Versions: 3.18.3, 3.19.0
> Reporter: Otavio Rodolfo Piske
> Assignee: Otavio Rodolfo Piske
> Priority: Major
> Fix For: 3.18.4, 3.20.0
>
>
> Quoting the report from an user on the users mailing list:
>
> ??Hi All,??
> ??I'm upgrading Camel from 3.16 to 3.17 and found a problem that OffsetRepository didn't get update after manual commit.??
> ??It is a Spring boot project and MemoryStateRepository as follows.??
> ?? @Bean??
> ?? public MemoryStateRepository offsetRepo() {??
> ?? MemoryStateRepository stateRepository = new MemoryStateRepository();??
> ?? stateRepository.setState(topic + "/0", "");??
> ?? return stateRepository;??
> ?? }??
> ??Here is the method I use when commit:??
> ?? private void commitOffsetToKafka(Exchange exchange) {??
> ?? KafkaManualCommit manual = exchange.getIn().getHeader(KafkaConstants.MANUAL_COMMIT, KafkaManualCommit.class);??
> ?? manual.commit();??
> ?? }??
> ??Here is my Kafka endpoint??
> ??kafka:integration_test _topic?brokers=[127.0.0.1:41478|http://127.0.0.1:41478/]&autoCommitEnable=false&allowManualCommit=true&seekTo=beginning&maxPollRecords=2&groupId=ANE&autoOffsetReset=earliest&offsetRepository=#offsetRepo&kafkaManualCommitFactory=#class:org.apache.camel.component.kafka.consumer.DefaultKafkaManualCommitFactory??
> ??It is working fine in 3.16. When DefaultkafkaManualSyncCommit.commit() is invoked. The offsetRepository.setState() get invoked so the offset increased.??
> ??However, in 3.17, DefaultkafkaManualSyncCommit.commit() doesn't have a reference to offsetRepository so the offset in offsetRepository won't get increased.??
> ??Is this a bug or there is a different way to get the offset after committing. Could you please suggest what I should do to test if the offset get increased after manual commit???
>
> This happened even after upgrading to Camel 3.18.3 as requested on the thread.
>
> This needs to be investigated further.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)