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 2017/03/03 19:36:25 UTC

[02/14] camel git commit: Added documentation around local cache updates before broadcast - functionality added with change of the pollDuration to 100ms default, and its externalization.

Added documentation around local cache updates before broadcast - functionality added with change of the pollDuration to 100ms default, and its externalization.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f1e503dc
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f1e503dc
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f1e503dc

Branch: refs/heads/master
Commit: f1e503dc4e924be70f00ab83bc89a4a0de7f1efc
Parents: 723e1af
Author: Jakub Korab <ja...@gmail.com>
Authored: Fri Mar 3 14:43:03 2017 +0000
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Mar 3 20:03:08 2017 +0100

----------------------------------------------------------------------
 .../idempotent/kafka/KafkaIdempotentRepository.java      | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f1e503dc/components/camel-kafka/src/main/java/org/apache/camel/processor/idempotent/kafka/KafkaIdempotentRepository.java
----------------------------------------------------------------------
diff --git a/components/camel-kafka/src/main/java/org/apache/camel/processor/idempotent/kafka/KafkaIdempotentRepository.java b/components/camel-kafka/src/main/java/org/apache/camel/processor/idempotent/kafka/KafkaIdempotentRepository.java
index 89034dd..be1740c 100644
--- a/components/camel-kafka/src/main/java/org/apache/camel/processor/idempotent/kafka/KafkaIdempotentRepository.java
+++ b/components/camel-kafka/src/main/java/org/apache/camel/processor/idempotent/kafka/KafkaIdempotentRepository.java
@@ -57,14 +57,19 @@ import org.slf4j.LoggerFactory;
 /**
  * A Kafka topic-based implementation of {@link org.apache.camel.spi.IdempotentRepository}.
  *
- * Uses a local cache of previously seen Message IDs. All mutations of the cache are via a Kafka topic, on which
- * additions and removals are broadcast. The topic used must be unique per repository instance. This class makes no
+ * Uses a local cache of previously seen Message IDs. Mutations that come in via the ({@link #add(String)}), or
+ * {@link #remove(String)} method will update the local cache and broadcasting the change in state on a Kafka topic.
+ *
+ * The topic used must be unique per repository instance. This class makes no
  * assumptions about number of partitions (it is designed to consume from all at the same time), or replication factor.
  * Each repository instance that uses the topic (e.g. on different machines running in parallel) controls its own
  * consumer group.
  *
  * On startup, the instance subscribes to the topic and rewinds the offset to the beginning, rebuilding the cache to the
- * latest state.
+ * latest state. The cache will not be considered to be warmed up until one poll of {@link #pollDurationMs} in length
+ * returns 0 records. Startup will not be completed until either the cache has warmed up, or 30 seconds go by; if the
+ * latter happens the idempotent repository may be in an inconsistent state until its consumer catches up to the end
+ * of the topic.
  *
  * To use, this repository must be placed in the Camel registry, either manually or by registration as a bean in
  * Spring/Blueprint, as it is CamelContext aware.