Child pages
  • JT400
Skip to end of metadata
Go to start of metadata

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:

    <!-- use the same version as your Camel core version -->

URI format


To call remote program (Camel 2.7)


You can append query options to the URI in the following format, ?option=value&option=value&...

URI options

For the data queue message exchange:

For the remote program call (Camel 2.7)


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.

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.

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!


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.

public class Jt400RouteBuilder extends RouteBuilder {
    public void configure() throws Exception {

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.

public class Jt400RouteBuilder extends RouteBuilder {
    public void configure() throws Exception {

Writing to keyed data queues


Reading from keyed data queues


  • No labels