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.  Sync Parallel Processing

    Posted Thu June 10, 2010 07:02 AM

    I have a requirement where I need to expose a web service which will in turn search for some data from two different system (e.g. System A and System B) by calling specific web services exposed by System A and System B.

    The data could be found in either or both of the system and I need to aggregate the data and return back to the main web service call.

    This complete processing needs to be executed in a synchronous way.

    To minimise the overall time taken by my main web service I want to execute the System A and System B web service parallelly in the main web service and once the response is back from both the system aggregate it and return it back.

    Not sure, what is the best approach to achieve this, your suggesting will be of great help.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 2.  RE: Sync Parallel Processing

    Posted Thu June 10, 2010 12:33 PM

    You can use an async pub/wait in your service. That will allow you to send out two request at the same time and marry up the responses. Pub/sub guide will give you the details on using it.


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: Sync Parallel Processing

    Posted Thu June 10, 2010 01:08 PM

    I actually want to achieve this in a synchronous process.

    One way I could think of is that as soon I get a call to my main web service I publish a document, which can in turn subscribe by the consumer of System A and System B web services and then publish the search result respectively.

    I can then have a subscriber with a join condition waiting for responses from System A and System B.

    This option looks ok in case everything works fine, however I am not too sure if one of the system processing get stuck, how to handle that.

    Is there any better approach?


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 4.  RE: Sync Parallel Processing

    Posted Thu June 10, 2010 01:15 PM

    You might want to read up on how the asynch pub/wait works, it will accomplish, without all the steps you just mentioned, what you want to do. You web service will still behave in a syncronous manner to the calling application. The asynch pub/wait is more akin to a callback.


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 5.  RE: Sync Parallel Processing

    Posted Thu June 10, 2010 09:26 PM

    Mark’s suggestion to use request/reply will work.

    Another way is to use doThreadInvoke in the IS API to invoke local services that make calls to the remote web services. Then join the threads. The threads can have wait timeouts.

    Conceptually, this is the same thing as the request/reply via Broker. Just different in the implementation details.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 6.  RE: Sync Parallel Processing

    Posted Mon June 14, 2010 08:27 AM

    Thanks Mark & Rob,

    I have now understood both the approaches. However I have one more point to clarify in the approach suggested by Mark.

    For a request/reply I could either use “publishAndWait” or “deliverAndWait” asynchronously, and then use “waitForReply” to capture the response. Could you please suggest that, if I am only going to have one subscriber for each publishable document then which one is the better approach?


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 7.  RE: Sync Parallel Processing

    Posted Mon June 14, 2010 04:40 PM