webMethods

 View Only
Expand all | Collapse all

MultiThreading in webMethods

  • 1.  MultiThreading in webMethods

    Posted Thu October 13, 2005 01:17 PM

    How is MultiThreading Handled in webMethods.Can any one Please explain?


    #webMethods
    #Integration-Server-and-ESB
    #webMethods-Archive


  • 2.  RE: MultiThreading in webMethods

    Posted Thu October 13, 2005 01:40 PM

    Probably going to need a little more detail on that question.

    markg
    http://darth.homelinux.net


    #Integration-Server-and-ESB
    #webMethods-Archive
    #webMethods


  • 3.  RE: MultiThreading in webMethods

    Posted Wed March 16, 2011 01:08 PM

    How to achieve MultiThreading in webMethods…
    For example i have three services one of them takes lot of time to execute and i dont want to wait for that service to complete its process as its output does’nt reflects the following services.
    In such situation i dont want to wait for a service whose output doesnt effect the services after it.


    #webMethods
    #Integration-Server-and-ESB
    #webMethods-Archive


  • 4.  RE: MultiThreading in webMethods

    Posted Wed March 16, 2011 01:14 PM

    How about calling those services inside a Map as Transformers?


    #Integration-Server-and-ESB
    #webMethods
    #webMethods-Archive


  • 5.  RE: MultiThreading in webMethods

    Posted Wed March 16, 2011 04:18 PM

    Transformers are not run in parallel. The documentation states:

    “Transformers in a MAP step are independent of each other and do not execute in a specific order. When inserting transformers, assume that webMethods Integration Server concurrently executes the transformers at run time.”

    The key word is “assume.” Based on observation, and in thinking about how an implementation would handle the complexity and overhead of threading each transformer, I’m confident that transformers are not executed concurrently. In a previous thread on this topic years ago, someone confirmed this observation.


    #webMethods-Archive
    #Integration-Server-and-ESB
    #webMethods


  • 6.  RE: MultiThreading in webMethods

    Posted Wed March 16, 2011 04:29 PM

    Other than not wanting to wait, is there any other technical reason to not wait? Have you considered how to handle and address errors by introducing additional complexity?

    It may be worth seeing if the long-running service can be split out from the others altogether and kicked off on its own.


    #webMethods
    #webMethods-Archive
    #Integration-Server-and-ESB


  • 7.  RE: MultiThreading in webMethods

    Posted Wed March 16, 2011 04:47 PM

    :slight_smile: :slight_smile:
    Thank you for quick reply…
    If we are using the service as a transformers in a service …then the service will be in the waiting state…until the transformer completes its job.

    I dont want any delay in my flow…
    I want to make a service asynchronous…


    #webMethods
    #Integration-Server-and-ESB
    #webMethods-Archive


  • 8.  RE: MultiThreading in webMethods

    Posted Wed March 16, 2011 04:49 PM

    My idea is to make a service asynchronous …
    Is it possible to achieve this in webMethods…?


    #Integration-Server-and-ESB
    #webMethods
    #webMethods-Archive


  • 9.  RE: MultiThreading in webMethods

    Posted Wed March 16, 2011 06:51 PM

    Let me reemphasize—using transformers does not involve multiple threads. The service will not be “waiting.” It will be executing the transformers, serially.


    #Integration-Server-and-ESB
    #webMethods-Archive
    #webMethods


  • 10.  RE: MultiThreading in webMethods

    Posted Wed March 16, 2011 06:53 PM

    How about making use of doInvoke ?
    It may make the parent service independent of the chaild execution.


    #webMethods
    #webMethods-Archive
    #Integration-Server-and-ESB


  • 11.  RE: MultiThreading in webMethods

    Posted Wed March 16, 2011 06:55 PM

    You can use the Java API, doThreadedInvoke.

    You could publish an event to the Broker and have a trigger that runs the service. You could publish the event locally, avoiding Broker.

    You could split the service out from the other service and have them both kicked off by something external.

    All of these add complexity to the solution. Make sure the added complexity is worthwhile and not just because you don’t want a service to have to wait.


    #webMethods
    #webMethods-Archive
    #Integration-Server-and-ESB


  • 12.  RE: MultiThreading in webMethods

    Posted Wed March 16, 2011 08:50 PM

    Okay… I think, I got your point… You are looking for something like PSUtilities.misc:spawnThread service… this service basically takes fully qualified name of a flow/java service with inputs and invokes a separate thread to execute the same… the output of the threaded service will not be available for the parent service… parallely both executes without depending on each other…

    HTH
    Senthil


    #webMethods
    #webMethods-Archive
    #Integration-Server-and-ESB


  • 13.  RE: MultiThreading in webMethods

    Posted Mon March 21, 2011 02:51 PM

    Thank you Senthil…
    Yes you got what i want…will try that
    :slight_smile: :slight_smile:


    #Integration-Server-and-ESB
    #webMethods
    #webMethods-Archive


  • 14.  RE: MultiThreading in webMethods

    Posted Mon March 21, 2011 04:59 PM

    I would avoid using doInvoke or doThreadedInvoke or any other code to invoke threads in nearly all cases. The natural ways to achieve multithreading in webMethods are

    • publishing a document and setting the receiving trigger to parallel with defined number of max threads (That’s what Rob already described).

    • if you are using processes, you can just draw parallel connections from a step to several following steps. If appropriate, you can join in afterwards with an and join to wait for all steps to finish. Parallel path in processes are processed in parallel (if the path are not limited by a condition).

    Both are imho good and proven ways in webMethods to achieve parallel processing.

    Regards

    Martin


    #Integration-Server-and-ESB
    #webMethods-Archive
    #webMethods


  • 15.  RE: MultiThreading in webMethods

    Posted Tue March 22, 2011 11:24 AM

    Publish the data (required for other services in the flow other then service which takes lot of time to execute) before that service which takes time. this way published document can be subscribed from broker through trigger which in turn execute rest of the flow steps in called service.


    #webMethods
    #webMethods-Archive
    #Integration-Server-and-ESB