You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2018/02/12 10:44:54 UTC

[camel] branch master updated: CAMEL-11497 - Added Threads EIP docs

This is an automated email from the ASF dual-hosted git repository.

acosentino 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 0e591f7  CAMEL-11497 - Added Threads EIP docs
0e591f7 is described below

commit 0e591f7ba259036fe2800160f01c303297b28632
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Feb 12 11:44:11 2018 +0100

    CAMEL-11497 - Added Threads EIP docs
---
 camel-core/src/main/docs/eips/threads-eip.adoc | 52 ++++++++++++++++++++++++++
 camel-core/src/main/docs/mock-component.adoc   |  2 +
 2 files changed, 54 insertions(+)

diff --git a/camel-core/src/main/docs/eips/threads-eip.adoc b/camel-core/src/main/docs/eips/threads-eip.adoc
new file mode 100644
index 0000000..8a5e71e
--- /dev/null
+++ b/camel-core/src/main/docs/eips/threads-eip.adoc
@@ -0,0 +1,52 @@
+[[threads-eip]]
+== Threads EIP
+The Threads Pattern allows you to introduce a thread pool into a route.
+
+== Options
+
+// eip options: START
+The Threads EIP supports 10 options which are listed below:
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *executorServiceRef* | To refer to a custom thread pool or use a thread pool profile (as overlay) |  | String
+| *poolSize* | Sets the core pool size |  | Integer
+| *maxPoolSize* | Sets the maximum pool size |  | Integer
+| *keepAliveTime* | Sets the keep alive time for idle threads |  | Long
+| *timeUnit* | Sets the keep alive time unit. By default SECONDS is used. |  | TimeUnit
+| *maxQueueSize* | Sets the maximum number of tasks in the work queue. Use -1 or Integer.MAX_VALUE for an unbounded queue |  | Integer
+| *allowCoreThreadTimeOut* | Whether idle core threads is allowed to timeout and therefore can shrink the pool size below the core pool size Is by default false | false | Boolean
+| *threadName* | Sets the thread name to use. | Threads | String
+| *rejectedPolicy* | Sets the handler for tasks which cannot be executed by the thread pool. |  | ThreadPoolRejected Policy
+| *callerRunsWhenRejected* | Whether or not to use as caller runs as fallback when a task is rejected being added to the thread pool (when its full). This is only used as fallback if no rejectedPolicy has been configured or the thread pool has no configured rejection handler. Is by default true | true | Boolean
+|===
+// eip options: END
+
+=== Samples
+
+The example below will add a Thread pool with a pool size of 5 threads before sending to *mock:result*.
+
+[source,java]
+----
+from("seda:a")
+  .threads(5)
+  .to("mock:result");
+----
+
+==== Spring DSL
+
+The sample below demonstrates the threads EIP in Spring DSL:
+
+[source,xml]
+----
+
+<camelContext xmlns="http://camel.apache.org/schema/spring">
+    <route>
+        <from uri="seda:a"/>
+        <threads poolSize="5"/>
+        <to uri="mock:result"/>
+    </route>
+</camelContext>
+----
diff --git a/camel-core/src/main/docs/mock-component.adoc b/camel-core/src/main/docs/mock-component.adoc
index 1ec13a6..b2d9406 100644
--- a/camel-core/src/main/docs/mock-component.adoc
+++ b/camel-core/src/main/docs/mock-component.adoc
@@ -1,6 +1,8 @@
 [[mock-component]]
 == Mock Component
 *Available as of Camel version 1.0*
+*Available as of Camel version 1.0*
+
 
 
 Testing of distributed and asynchronous processing is

-- 
To stop receiving notification emails like this one, please contact
acosentino@apache.org.