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/01/12 09:33:26 UTC

[2/3] camel git commit: CAMEL-10696 - Add documentation

CAMEL-10696 - Add documentation


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

Branch: refs/heads/master
Commit: 931d4678c8b2cf24131a232d81ad7fd0ba170ddb
Parents: 92df581
Author: Antoine DESSAIGNE <an...@gmail.com>
Authored: Wed Jan 11 21:50:17 2017 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Jan 12 10:27:41 2017 +0100

----------------------------------------------------------------------
 .../camel-kafka/src/main/docs/kafka-component.adoc     | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/931d4678/components/camel-kafka/src/main/docs/kafka-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-kafka/src/main/docs/kafka-component.adoc b/components/camel-kafka/src/main/docs/kafka-component.adoc
index ea1a199..bd170e3 100644
--- a/components/camel-kafka/src/main/docs/kafka-component.adoc
+++ b/components/camel-kafka/src/main/docs/kafka-component.adoc
@@ -181,6 +181,19 @@ from("kafka:localhost:9092?topic=test&groupId=testing&autoOffsetReset=earliest&c
                         }).to("log:input");
 -------------------------------------------------------------------------------------------------
 
+
+When consuming messages from Kafka you can use your own offset management and not delegate this management to Kafka.
+In order to keep the offsets the component needs a `StateRepository` implementation such as `FileStateRepository`.
+This bean should be available in the registry.
+Here how to use it :
+[source,java]
+-------------------------------------------------------------------------------------------------------------------
+from("kafka:localhost:{{kafkaPort}}?topic=" + TOPIC +  //
+             "&groupId=A" +                            //
+             "&autoOffsetReset=earliest" +             // Ask to start from the beginning if we have unknown offset
+             "&offsetRepository=#repo")                // Keep the offsets in our repository named "repo"
+        .to("mock:result");
+-------------------------------------------------------------------------------------------------------------------
 �
 
 Producing messages: