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

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 105aedd6bc2fb01898ae4a87e9252901be5018bb
Author: Andrea Cosentino <anco...@gmail.com>
AuthorDate: Thu Sep 2 07:24:12 2021 +0200

    Sync and regen
---
 camel-dependencies/pom.xml                         |  2 +-
 .../camel-jt400/src/main/docs/jt400-component.adoc |  1 +
 .../modules/ROOT/pages/jt400-component.adoc        | 55 +++++++++++++++++-----
 3 files changed, 44 insertions(+), 14 deletions(-)

diff --git a/camel-dependencies/pom.xml b/camel-dependencies/pom.xml
index 0b73f41..d2f8339 100644
--- a/camel-dependencies/pom.xml
+++ b/camel-dependencies/pom.xml
@@ -66,7 +66,7 @@
     <avro-ipc-netty-version>1.10.2</avro-ipc-netty-version>
     <avro-version>1.10.2</avro-version>
     <awaitility-version>4.1.0</awaitility-version>
-    <aws-java-sdk2-version>2.17.31</aws-java-sdk2-version>
+    <aws-java-sdk2-version>2.17.32</aws-java-sdk2-version>
     <aws-xray-version>2.6.1</aws-xray-version>
     <axiom-version>1.2.14</axiom-version>
     <azure-jackson2-version>2.11.3</azure-jackson2-version>
diff --git a/components/camel-jt400/src/main/docs/jt400-component.adoc 
b/components/camel-jt400/src/main/docs/jt400-component.adoc
index eb6320b..027862c 100644
--- a/components/camel-jt400/src/main/docs/jt400-component.adoc
+++ b/components/camel-jt400/src/main/docs/jt400-component.adoc
@@ -124,6 +124,7 @@ with the following path and query parameters:
 | *password* | *Required* Returns the password of the IBM i user. |  | String
 | *systemName* | *Required* Returns the name of the IBM i system. |  | String
 | *objectPath* | *Required* Returns the fully qualified integrated file system 
path name of the target object of this endpoint. |  | String
+| *type* | *Required* Whether to work with data queues or remote program call. 
There are 4 enums and the value can be one of: DTAQ, PGM, SRVPGM, MSGQ |  | 
Jt400Type
 |===
 
 
diff --git a/docs/components/modules/ROOT/pages/jt400-component.adoc 
b/docs/components/modules/ROOT/pages/jt400-component.adoc
index 12d1ae2..ba6f94e 100644
--- a/docs/components/modules/ROOT/pages/jt400-component.adoc
+++ b/docs/components/modules/ROOT/pages/jt400-component.adoc
@@ -45,7 +45,7 @@ To send or receive messages from a message queue
 jt400://user:password@system/QSYS.LIB/LIBRARY.LIB/QUEUE.MSGQ[?options]
 ----------------------------------------------------------------------
 
-To call remote program
+To call program
 
 -----------------------------------------------------------------------
 jt400://user:password@system/QSYS.LIB/LIBRARY.LIB/program.PGM[?options]
@@ -176,14 +176,14 @@ with the following path and query parameters:
 == Usage
 
 When configured as a data queue consumer endpoint, the endpoint will poll a 
data
-queue on a remote system. For every entry on the data queue, a new
+queue on an IBM i 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.
 
 When configured as a message queue consumer endpoint, the endpoint will poll
-a message queue on a remote system. For every entry on the queue, a new
+a message queue on an IBM i system. For every entry on the queue, a new
 `Exchange` is sent with the entry's data in the _In_ message's body. The
 data is always formatted as a `String`. Note that only new messages will
 be processed. That is, any existing messages on the queue that have already
@@ -201,16 +201,19 @@ Inquiry messages or messages requiring a message ID are 
not supported.
 You can explicit configure a connection pool on the Jt400Component, or as an 
uri option
 on the endpoint.
 
-=== Remote program call
+=== Program call
 
-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!
+This endpoint expects the input to be an `Object[]`, whose object types are
+`int`, `long`, `CharSequence` (such as `String`), or `byte[]`. All other
+data types in the input array will be converted to `String`. For character
+inputs, CCSID handling is performed through the native jt400 library
+mechanisms. A parameter can be _omitted_ by passing null as the value in
+its position (the program has to support it). After the program execution,
+the endpoint returns an `Object[]` in the message body. Depending on
+_format_, the returned array will be populated with `byte[]` or `String`
+objects representing the values as they were returned by the program. Input
+only parameters will contain the same data as the beginning of the invocation.
+This endpoint does not implement a provider endpoint!
 
 == Message headers
 
@@ -267,7 +270,7 @@ public class Jt400RouteBuilder extends RouteBuilder {
 }
 
-------------------------------------------------------------------------------------------------------
 
-=== Remote program call example
+=== Program call examples
 
 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
@@ -285,6 +288,32 @@ public class Jt400RouteBuilder extends RouteBuilder {
 }
 
---------------------------------------------------------------------------------------------------------------------------------------------------------
 
+In this example, the camel route will call the QUSRTVUS API to retrieve
+16 bytes from data area "MYUSRSPACE" in the "MYLIB" library.
+
+[source,java]
+---------------------------------------------------------------------------------------------------------------------------------------------------------
+public class Jt400RouteBuilder extends RouteBuilder {
+    @Override
+    public void configure() throws Exception {
+        from("timer://foo?period=60000")
+        .process( exchange -> {
+            String usrSpc = "MYUSRSPACEMYLIB     ";
+            Object[] parms = new Object[] {
+                usrSpc, // Qualified user space name
+                1,      // starting position
+                16,     // length of data
+                "" // output
+            };
+            exchange.getIn().setBody(parms);
+        })
+        
.to("jt400://*CURRENT:*CURRENt@localhost/qsys.lib/QUSRTVUS.PGM?fieldsLength=20,4,4,16&outputFieldsIdx=3")
+        .setBody(simple("${body[3]}"))
+        .to("direct:foo");
+    }
+}
+---------------------------------------------------------------------------------------------------------------------------------------------------------
+
 === Writing to keyed data queues
 
 [source,java]

Reply via email to