Repository: camel
Updated Branches:
  refs/heads/master 438623d2b -> d659cd313


Added camel-jt400 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/d659cd31
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d659cd31
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d659cd31

Branch: refs/heads/master
Commit: d659cd313d3d307d5933cbddff857a8370a4ebcc
Parents: 438623d
Author: Andrea Cosentino <anco...@gmail.com>
Authored: Tue May 3 08:31:39 2016 +0200
Committer: Andrea Cosentino <anco...@gmail.com>
Committed: Tue May 3 08:31:39 2016 +0200

----------------------------------------------------------------------
 components/camel-jt400/src/main/docs/jt400.adoc | 205 +++++++++++++++++++
 docs/user-manual/en/SUMMARY.md                  |   1 +
 2 files changed, 206 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/d659cd31/components/camel-jt400/src/main/docs/jt400.adoc
----------------------------------------------------------------------
diff --git a/components/camel-jt400/src/main/docs/jt400.adoc 
b/components/camel-jt400/src/main/docs/jt400.adoc
new file mode 100644
index 0000000..02fdad7
--- /dev/null
+++ b/components/camel-jt400/src/main/docs/jt400.adoc
@@ -0,0 +1,205 @@
+[[JT400-JT400Component]]
+JT/400 Component
+~~~~~~~~~~~~~~~~
+
+The *`jt400`* component allows you to exchanges messages with an AS/400
+system using data queues.
+
+Maven users will need to add the following dependency to their `pom.xml`
+for this component:
+
+[source,xml]
+------------------------------------------------------------
+<dependency>
+    <groupId>org.apache.camel</groupId>
+    <artifactId>camel-jt400</artifactId>
+    <version>x.x.x</version>
+    <!-- use the same version as your Camel core version -->
+</dependency>
+------------------------------------------------------------
+
+[[JT400-URIformat]]
+URI format
+^^^^^^^^^^
+
+[source,java]
+----------------------------------------------------------------------
+jt400://user:password@system/QSYS.LIB/LIBRARY.LIB/QUEUE.DTAQ[?options]
+----------------------------------------------------------------------
+
+To call remote program (*Camel 2.7*)
+
+[source,java]
+-----------------------------------------------------------------------
+jt400://user:password@system/QSYS.LIB/LIBRARY.LIB/program.PGM[?options]
+-----------------------------------------------------------------------
+
+You can append query options to the URI in the following format,
+`?option=value&option=value&...`
+
+[[JT400-options]]
+JT400 options
+^^^^^^^^^^^^^
+
+
+// component options: START
+The JT400 component supports 1 options which are listed below.
+
+
+
+[width="100%",cols="2s,1m,8",options="header"]
+|=======================================================================
+| Name | Java Type | Description
+| connectionPool | AS400ConnectionPool | Returns the default connection pool 
used by this component.
+|=======================================================================
+// component options: END
+
+
+
+// endpoint options: START
+The JT400 component supports 33 endpoint options which are listed below:
+
+[width="100%",cols="2s,1,1m,1m,5",options="header"]
+|=======================================================================
+| Name | Group | Default | Java Type | Description
+| userID | common |  | String | *Required* Returns the ID of the AS/400 user.
+| password | common |  | String | *Required* Returns the password of the 
AS/400 user.
+| systemName | common |  | String | *Required* Returns the name of the AS/400 
system.
+| objectPath | common |  | String | *Required* Returns the fully qualified 
integrated file system path name of the target object of this endpoint.
+| type | common |  | Jt400Type | *Required* Whether to work with data queues 
or remote program call
+| ccsid | common |  | int | Sets the CCSID to use for the connection with the 
AS/400 system.
+| format | common | text | Format | Sets the data format for sending messages.
+| guiAvailable | common | false | boolean | Sets whether AS/400 prompting is 
enabled in the environment running Camel.
+| keyed | common | false | boolean | Whether to use keyed or non-keyed data 
queues.
+| outputFieldsIdxArray | common |  | Integer[] | Specifies which fields 
(program parameters) are output parameters.
+| outputFieldsLengthArray | common |  | Integer[] | Specifies the fields 
(program parameters) length as in the AS/400 program definition.
+| searchKey | common |  | String | Search key for keyed data queues.
+| searchType | common | EQ | SearchType | Search type such as EQ for equal etc.
+| secured | common | false | boolean | Whether connections to AS/400 are 
secured with SSL.
+| bridgeErrorHandler | consumer | false | boolean | Allows for bridging the 
consumer to the Camel routing Error Handler which mean any exceptions occurred 
while the consumer is trying to pickup incoming messages or the likes will now 
be processed as a message and handled by the routing Error Handler. By default 
the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with 
exceptions that will be logged at WARN/ERROR level and ignored.
+| sendEmptyMessageWhenIdle | consumer | false | boolean | If the polling 
consumer did not poll any files you can enable this option to send an empty 
message (no body) instead.
+| exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the 
consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler 
is enabled then this options is not in use. By default the consumer will deal 
with exceptions that will be logged at WARN/ERROR level and ignored.
+| pollStrategy | consumer (advanced) |  | PollingConsumerPollStrategy | A 
pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to 
provide your custom implementation to control error handling usually occurred 
during the poll operation before an Exchange have been created and being routed 
in Camel.
+| exchangePattern | advanced | InOnly | ExchangePattern | Sets the default 
exchange pattern when creating an exchange
+| synchronous | advanced | false | boolean | Sets whether synchronous 
processing should be strictly used or Camel is allowed to use asynchronous 
processing (if supported).
+| backoffErrorThreshold | scheduler |  | int | The number of subsequent error 
polls (failed due some error) that should happen before the backoffMultipler 
should kick-in.
+| backoffIdleThreshold | scheduler |  | int | The number of subsequent idle 
polls that should happen before the backoffMultipler should kick-in.
+| backoffMultiplier | scheduler |  | int | To let the scheduled polling 
consumer backoff if there has been a number of subsequent idles/errors in a 
row. The multiplier is then the number of polls that will be skipped before the 
next actual attempt is happening again. When this option is in use then 
backoffIdleThreshold and/or backoffErrorThreshold must also be configured.
+| delay | scheduler | 500 | long | Milliseconds before the next poll.
+| greedy | scheduler | false | boolean | If greedy is enabled then the 
ScheduledPollConsumer will run immediately again if the previous run polled 1 
or more messages.
+| initialDelay | scheduler | 1000 | long | Milliseconds before the first poll 
starts.
+| runLoggingLevel | scheduler | TRACE | LoggingLevel | The consumer logs a 
start/complete log line when it polls. This option allows you to configure the 
logging level for that.
+| scheduledExecutorService | scheduler |  | ScheduledExecutorService | Allows 
for configuring a custom/shared thread pool to use for the consumer. By default 
each consumer has its own single threaded thread pool.
+| scheduler | scheduler | none | ScheduledPollConsumerScheduler | To use a 
cron scheduler from either camel-spring or camel-quartz2 component
+| schedulerProperties | scheduler |  | Map | To configure additional 
properties when using a custom scheduler or any of the Quartz2 Spring based 
scheduler.
+| startScheduler | scheduler | true | boolean | Whether the scheduler should 
be auto started.
+| timeUnit | scheduler | MILLISECONDS | TimeUnit | Time unit for initialDelay 
and delay options.
+| useFixedDelay | scheduler | true | boolean | Controls if fixed delay or 
fixed rate is used. See ScheduledExecutorService in JDK for details.
+|=======================================================================
+// endpoint options: END
+
+
+[[JT400-Usage]]
+Usage
+^^^^^
+
+When configured as a consumer endpoint, the endpoint will poll a data
+queue on a remote system. For every entry on the data queue, a new
+`Exchange` is sent with the entry's data in the _In_ message's body,
+formatted either as a `String` or a `byte[]`, depending on the format.
+For a provider endpoint, the _In_ message body contents will be put on
+the data queue as either raw bytes or text.
+
+[[JT400-Connectionpool]]
+Connection pool
+^^^^^^^^^^^^^^^
+
+*Available as of Camel 2.10*
+
+Connection pooling is in use from Camel 2.10 onwards. You can explicit
+configure a connection pool on the Jt400Component, or as an uri option
+on the endpoint.
+
+[[JT400-Remoteprogramcall]]
+Remote program call (*Camel 2.7*)
++++++++++++++++++++++++++++++++++
+
+This endpoint expects the input to be either a String array or byte[]
+array (depending on format) and handles all the CCSID handling through
+the native jt400 library mechanisms. A parameter can be _omitted_ by
+passing null as the value in its position (the remote program has to
+support it). After the program execution the endpoint returns either a
+String array or byte[] array with the values as they were returned by
+the program (the input only parameters will contain the same data as the
+beginning of the invocation). This endpoint does not implement a provider 
endpoint!
+
+[[JT400-Example]]
+Example
+^^^^^^^
+
+In the snippet below, the data for an exchange sent to the
+`direct:george` endpoint will be put in the data queue `PENNYLANE` in
+library `BEATLES` on a system named `LIVERPOOL`.  +
+ Another user connects to the same data queue to receive the information
+from the data queue and forward it to the `mock:ringo` endpoint.
+
+[source,java]
+-------------------------------------------------------------------------------------------------------
+public class Jt400RouteBuilder extends RouteBuilder {
+    @Override
+    public void configure() throws Exception {
+       
from("direct:george").to("jt400://GEORGE:EGROEG@LIVERPOOL/QSYS.LIB/BEATLES.LIB/PENNYLANE.DTAQ");
+       
from("jt400://RINGO:OGNIR@LIVERPOOL/QSYS.LIB/BEATLES.LIB/PENNYLANE.DTAQ").to("mock:ringo");
+    }
+}
+-------------------------------------------------------------------------------------------------------
+
+[[JT400-Remoteprogramcallexample]]
+Remote program call example (*Camel 2.7*)
++++++++++++++++++++++++++++++++++++++++++
+
+In the snippet below, the data Exchange sent to the direct:work endpoint
+will contain three string that will be used as the arguments for the
+program “compute” in the library “assets”. This program will write the
+output values in the 2nd and 3rd parameters. All the parameters will be
+sent to the direct:play endpoint.
+
+[source,java]
+---------------------------------------------------------------------------------------------------------------------------------------------------------
+public class Jt400RouteBuilder extends RouteBuilder {
+    @Override
+    public void configure() throws Exception {
+       
from("direct:work").to("jt400://GRUPO:ATWORK@server/QSYS.LIB/assets.LIB/compute.PGM?fieldsLength=10,10,512&ouputFieldsIdx=2,3").to(“direct:play”);
+    }
+}
+---------------------------------------------------------------------------------------------------------------------------------------------------------
+
+[[JT400-Writingtokeyeddataqueues]]
+Writing to keyed data queues
+++++++++++++++++++++++++++++
+
+[source,java]
+------------------------------------------------------------------------
+from("jms:queue:input")
+.to("jt400://username:password@system/lib.lib/MSGINDQ.DTAQ?keyed=true");
+------------------------------------------------------------------------
+
+[[JT400-Readingfromkeyeddataqueues]]
+Reading from keyed data queues
+++++++++++++++++++++++++++++++
+
+[source,java]
+-------------------------------------------------------------------------------------------------------
+from("jt400://username:password@system/lib.lib/MSGOUTDQ.DTAQ?keyed=true&searchKey=MYKEY&searchType=GE")
+.to("jms:queue:output");
+-------------------------------------------------------------------------------------------------------
+
+[[JT400-SeeAlso]]
+See Also
+^^^^^^^^
+
+* link:configuring-camel.html[Configuring Camel]
+* link:component.html[Component]
+* link:endpoint.html[Endpoint]
+* link:getting-started.html[Getting Started]
+

http://git-wip-us.apache.org/repos/asf/camel/blob/d659cd31/docs/user-manual/en/SUMMARY.md
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md
index e471da1..7a7b8df 100644
--- a/docs/user-manual/en/SUMMARY.md
+++ b/docs/user-manual/en/SUMMARY.md
@@ -176,6 +176,7 @@
     * [JIRA](jira.adoc)
     * [Jolt](jolt.adoc)
     * [Jpa](jpa.adoc)
+    * [JT400](jt400.adoc)
     * [Kafka](kafka.adoc)
     * [Metrics](metrics.adoc)
     * [Mock](mock.adoc)

Reply via email to