IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  For Each Loop

    Posted Mon August 24, 2020 12:32 PM

    When you need to process each element of an array but would want to allow for parallel execution in order to speed up the processing, the For … Each… loop seems to not work well.
    Is there an alternative that would allow parallel execution of the “loop” before continuing when all results are gathered?


    #webMethods
    #webMethods-io-Integration


  • 2.  RE: For Each Loop

    Posted Mon August 24, 2020 02:24 PM

    Hi Mike,

    Are you asking specifically about Loop action with in the workflow or IO flow service based Loop and aggregate data results at the end sort of logic? Please clarify us.

    HTH,
    RMG


    #webMethods-io-Integration
    #webMethods


  • 3.  RE: For Each Loop

    Posted Mon August 24, 2020 02:44 PM

    anything that would allow parallel processing, so I’m not bothered if the answer isn’t based on a foreach loop. It’s just that foreach automatically comes to mind (probably based on linguistics)

    so step A produces array [a,b,c]. Next step executes same step once for a, once for b and once for c. Order is not important


    #webMethods
    #webMethods-io-Integration


  • 4.  RE: For Each Loop

    Posted Tue August 25, 2020 12:01 PM

    So you mean to say similar to concurrent processing (where order doesn’t matter)??
    But I am also not sure if any OOTB parallel-foreach is available yet apart from handling with custom java code can be achieved or sort of.


    #webMethods
    #webMethods-io-Integration


  • 5.  RE: For Each Loop

    Posted Fri August 28, 2020 06:59 PM

    Are you using webMethods.io or on premise Integration Server?

    For Integration Server, you could probably use messaging to achieve this

    If you don’t need to aggregate results, just call pub.publish:publish for every element in your array. The subscriber will process each message asynchronously. With the subscriber trigger settings you can control how much concurrency (i.e. threads) to allow.

    If you need to collect all the results, that would be tricky.

    It may work to call pub.publish:publishAndWait with async=true for each element and record all the returned “tag” values in an array.

    Then call pub.publish:waitForReply in a loop for each tag to gather all the asynchronous processing results


    #webMethods-io-Integration
    #webMethods


  • 6.  RE: For Each Loop

    Posted Sat August 29, 2020 12:44 PM

    You could publish N documents so that a trigger (which you’ll have to set up) is fired N times.


    #webMethods-io-Integration
    #webMethods


  • 7.  RE: For Each Loop

    Posted Mon August 31, 2020 10:05 AM

    Yes as Dave mentioned above you can make use of Pub/Sub (Broker/UM) Async architecture and subscription service side collect the aggregate the results for further reporting downstream etc…

    HTH,
    RMG


    #webMethods
    #webMethods-io-Integration