Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.6.0
    • Fix Version/s: 2.7.0
    • Component/s: None
    • Patch Info:
      Patch Available

      Description

      I've added a new feature to the existing camel-jt400 component to enable the remote program call of iSeries programs.
      This implementation was successfully tested with the jt400 library already included in the pom dependencies against real systems running the version V5R4 od the OS.

      The usage of this new feature is exactly the same of the DATQ feature except the path now has to point to a PGM file and there are 2 mandatory arguments: outputFieldsIdx and fieldsLength.

      outputFieldsIdx register which parameters of the program will be INPUT/OUTPUT (as oposed of only INPUT)
      fieldsLength: registers the mandatory parameters length

      Sample usage in a route (included in the test case)

      from("direct:a").to("jt400://user:password@host/QSYS.LIB/library.LIB/program.pgm?outputFieldsIdx=1,2&fieldsLength=4,512,2").to("mock:a");

      I'm including a patch to both 2.6.0 and trunk as of today.

      Please let me know if something is not OK.. I'm more than happy to make the adjustments.

      1. patch_camel-jt400_pgm_call_trunk.txt
        18 kB
        Luis Santos
      2. patch_camel-jt400_pgm_call_exception_handling_trunk.txt
        2 kB
        Luis Santos
      3. patch_camel-jt400_pgm_call_2.6.0.txt
        18 kB
        Luis Santos
      4. camel-jt400-documentation.rtf
        71 kB
        Luis Santos

        Activity

        Hide
        Luis Santos added a comment -

        trunk patch

        Show
        Luis Santos added a comment - trunk patch
        Hide
        Luis Santos added a comment -

        patch to 2.6.0 tag

        Show
        Luis Santos added a comment - patch to 2.6.0 tag
        Hide
        Willem Jiang added a comment -

        Hi Luis,

        Thanks for your contribution, I just applied you patch by fixing some check style issue and changing to use slf4j logger.
        Here is one question for the Jt400PgmProducer that you new add.
        When the pgmCall failed, do we need to throw an exception to fire the camel error handler?
        I don't think it's a good idea that just print the message out.

        
                boolean result = pgmCall.run();
        
                if (LOG.isTraceEnabled()) {
                    LOG.trace("Executed PGM '" + commandStr + "' in host '" + iSeries.getSystemName() + "'. Success?"
                             + result);
                }
        
                if (result) {
                    handlePGMOutput(exchange, pgmCall, parameterList);
                } else {
                    // TODO Do we need to throw an exception here
                    handleMessages(pgmCall);
                }
        

        Willem

        Show
        Willem Jiang added a comment - Hi Luis, Thanks for your contribution, I just applied you patch by fixing some check style issue and changing to use slf4j logger. Here is one question for the Jt400PgmProducer that you new add. When the pgmCall failed, do we need to throw an exception to fire the camel error handler? I don't think it's a good idea that just print the message out. boolean result = pgmCall.run(); if (LOG.isTraceEnabled()) { LOG.trace( "Executed PGM '" + commandStr + "' in host '" + iSeries.getSystemName() + "'. Success?" + result); } if (result) { handlePGMOutput(exchange, pgmCall, parameterList); } else { // TODO Do we need to throw an exception here handleMessages(pgmCall); } Willem
        Hide
        Claus Ibsen added a comment -

        We need this new feature documented in the wiki page.
        http://camel.apache.org/jt400

        Luis do you mind helping out with that?
        Maybe you can sketch up some documentation in a .txt file and attach to this JIRA?

        Show
        Claus Ibsen added a comment - We need this new feature documented in the wiki page. http://camel.apache.org/jt400 Luis do you mind helping out with that? Maybe you can sketch up some documentation in a .txt file and attach to this JIRA?
        Hide
        Luis Santos added a comment - - edited

        @Willem Jiang
        I'm attaching a better excpetion handling when the execution fails. You weere righ, i belive that in case the execution is not successfull (ie program crash/error) the messages should be encapsulated in a excption to camel.

        As i'm seeing this the path will only be applied to the trunk so only this patch is being submited now, is this correct?

        @Claus Ibsen
        I'm attaching a reviewd documentation page for the camel-jt400 component

        Show
        Luis Santos added a comment - - edited @Willem Jiang I'm attaching a better excpetion handling when the execution fails. You weere righ, i belive that in case the execution is not successfull (ie program crash/error) the messages should be encapsulated in a excption to camel. As i'm seeing this the path will only be applied to the trunk so only this patch is being submited now, is this correct? @Claus Ibsen I'm attaching a reviewd documentation page for the camel-jt400 component
        Hide
        Luis Santos added a comment -

        Documentation page

        Show
        Luis Santos added a comment - Documentation page
        Hide
        Claus Ibsen added a comment -

        @Luis

        Thanks for the documentation. I have updated the wiki.

        Show
        Claus Ibsen added a comment - @Luis Thanks for the documentation. I have updated the wiki.
        Hide
        Claus Ibsen added a comment -

        Thanks for the patch: 1077837.

        Show
        Claus Ibsen added a comment - Thanks for the patch: 1077837.

          People

          • Assignee:
            Willem Jiang
            Reporter:
            Luis Santos
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development