Added delay-interceptor docs to Gitbook

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

Branch: refs/heads/master
Commit: 6e55d2a1bd9694aa7c74c814f3bde817ee3c3610
Parents: bf9ecdc
Author: Andrea Cosentino <anco...@gmail.com>
Authored: Tue Jul 19 10:39:13 2016 +0200
Committer: Andrea Cosentino <anco...@gmail.com>
Committed: Tue Jul 19 10:39:13 2016 +0200

----------------------------------------------------------------------
 docs/user-manual/en/SUMMARY.md             |  2 +-
 docs/user-manual/en/delay-interceptor.adoc | 87 +++++++++++++++++++++++++
 2 files changed, 88 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/6e55d2a1/docs/user-manual/en/SUMMARY.md
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md
index 312bbc6..cf1ef2d 100644
--- a/docs/user-manual/en/SUMMARY.md
+++ b/docs/user-manual/en/SUMMARY.md
@@ -14,6 +14,7 @@
     * [BrowsableEndpoint](browsable-endpoint.adoc)
     * [CamelContext](camelcontext.adoc)
     * [Debugger](debugger.adoc)
+    * [Delay Interceptor](delay-interceptor.adoc)
     * [Dozer Type Conversion](dozer-type-conversion.adoc)
     * [Endpoint](endpoint.adoc)
     * [Exchange](exchange.adoc)
@@ -26,7 +27,6 @@
 <!--
     * [AOP](aop.adoc)
     * [Camel-Core](camel-core.adoc)
-    * [Delay Interceptor](delay-interceptor.adoc)
     * [Dependency Injection](dependency-injections.adoc)
     * [DSL](dsl.adoc)
     * [Error Handler](.adoc)

http://git-wip-us.apache.org/repos/asf/camel/blob/6e55d2a1/docs/user-manual/en/delay-interceptor.adoc
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/delay-interceptor.adoc 
b/docs/user-manual/en/delay-interceptor.adoc
new file mode 100644
index 0000000..72d8b5b
--- /dev/null
+++ b/docs/user-manual/en/delay-interceptor.adoc
@@ -0,0 +1,87 @@
+[[DelayInterceptor-DelayInterceptor]]
+Delay Interceptor
+~~~~~~~~~~~~~~~~~
+
+*Available in Camel 1.5*
+
+The Delay interceptor is an route interceptor that is used for slowing
+processing of messages down. This allows you to enable this interceptor
+and set a fixed amount of delay between each step a message passes in
+the route path, to show how things is happening nice and slowly, so you
+are not bombarded with a zillion lines of logging output.
+
+The delay interceptor can be configured as follows:
+
+* setting the delay attribute in the spring camelContext tag.
+* adding the delay interceptor to the CamelContext in Java code.
+
+[[DelayInterceptor-ConfiguringusingSpring]]
+Configuring using Spring
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+Just set the delay attribute of the camelContext tag as shown below:
+
+[source,xml]
+--------------------------------------------------------------------------------------------------
+    <camelContext id="camel" delayer="500" 
xmlns="http://activemq.apache.org/camel/schema/spring";>
+        <route>
+            <from uri="direct:start"/>
+            <to uri="mock:result"/>
+        </route>
+    </camelContext>
+--------------------------------------------------------------------------------------------------
+
+[[DelayInterceptor-ConfiguringusingJava]]
+Configuring using Java
+^^^^^^^^^^^^^^^^^^^^^^
+
+You can add the delayer interceptor in the RouteBulder as shown below:
+
+[source,java]
+------------------------------------------------------------------
+    public void configure() throws Exception {
+        // add the delay interceptor to delay each step 200 millis
+        getContext().addInterceptStrategy(new Delayer(200));
+
+       ... // regular routes here
+    }
+------------------------------------------------------------------
+
+In *Camel 2.0* its a bit easier as you can just do
+
+[source,java]
+-----------------------------
+getContext().setDelayer(200);
+-----------------------------
+
+[[DelayInterceptor-Granularity]]
+Granularity
+^^^^^^^^^^^
+
+In *Camel 2.0* you can configure it on both camel context and per route
+as you like. Per route will override the camel context setting. +
+ For example the route below is only the first route that has a delayer
+with 200 millis.
+
+[source,java]
+------------------------
+<camelContext ...>
+
+   <route delayer="200">
+     ...
+   </route>
+
+   <route>
+     ...
+   </route>
+
+</camelContext>
+------------------------
+
+[[DelayInterceptor-SeeAlso]]
+See Also
+^^^^^^^^
+
+* link:tracer.html[Tracer]
+* link:debugger.html[Debugger]
+

Reply via email to