You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2018/08/16 13:28:06 UTC
[camel] branch master updated: CAMEL-12732 Take into account
isAllowManualCommit (#2478)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new f5c7352 CAMEL-12732 Take into account isAllowManualCommit (#2478)
f5c7352 is described below
commit f5c73520c475f13c507350f9567307fc17e6019a
Author: elbaz michael <mi...@outlook.fr>
AuthorDate: Thu Aug 16 15:27:59 2018 +0200
CAMEL-12732 Take into account isAllowManualCommit (#2478)
Check isAllowManualCommit before setting the state
(Fix the manual commit for the state)
---
.../src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java
index e6913f3..df3b4b5 100644
--- a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java
+++ b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java
@@ -399,7 +399,7 @@ public class KafkaConsumer extends DefaultConsumer {
private void commitOffset(StateRepository<String, String> offsetRepository, TopicPartition partition, long partitionLastOffset, boolean forceCommit) {
if (partitionLastOffset != -1) {
- if (offsetRepository != null) {
+ if (!endpoint.getConfiguration().isAllowManualCommit() && offsetRepository != null) {
log.debug("Saving offset repository state {} from topic {} with offset: {}", threadId, topicName, partitionLastOffset);
offsetRepository.setState(serializeOffsetKey(partition), serializeOffsetValue(partitionLastOffset));
} else if (forceCommit) {