webMethods

webMethods

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
Expand all | Collapse all

Sending acknowledgement 200 http

  • 1.  Sending acknowledgement 200 http

    Posted Thu May 06, 2004 10:30 AM

    Hey,

    I got the follwoing issue:

    I receive a http request from a java program, and i receive an xml.
    Now i want to resend an acknowdlegement ‘200’ to the program, but before the flow which receives the request is finished…

    How do we do this?

    greetz,

    Wout


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


  • 2.  RE: Sending acknowledgement 200 http

    Posted Thu May 06, 2004 02:38 PM

    Have you tried using with pub.flow:setResponse service.

    HTH,


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


  • 3.  RE: Sending acknowledgement 200 http

    Posted Thu May 06, 2004 07:59 PM

    Wout

    http 200 gets returned only when the process completes.
    You might want to invoke a java service as the entry that will kick of the original flow with a Threaded invoke.
    Like this

    Service.doThreadInvoke( “namespace”, “servicename”, pipeline );

    -Ravi


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


  • 4.  RE: Sending acknowledgement 200 http

    Posted Thu May 06, 2004 08:02 PM

    Or If you are positing to Tn Recieve… Make the Processing rule as Asynchronous


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


  • 5.  RE: Sending acknowledgement 200 http

    Posted Thu May 06, 2004 08:51 PM

    Wout,

    Can you tell us why you want to ACK http 200 with out completing the process?Just wanted to know as a curiosity.

    Regards,


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


  • 6.  RE: Sending acknowledgement 200 http

    Posted Fri May 07, 2004 07:39 AM

    The reason I want to do this is that I receive an XML over http and with this XML I do a some validations, i publish and wait a document and then i update a stored procedure.

    But there is no reason why the sender of the XML has to wait untill I update the stored procedure. I want to send the acknowledgement, that I received the XML immediately so that the sending process can continue.

    regards,

    Wout


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


  • 7.  RE: Sending acknowledgement 200 http

    Posted Fri May 07, 2004 09:41 AM

    > But there is no reason why the sender of the XML has to wait untill
    > I update the stored procedure. I want to send the acknowledgement,
    > that I received the XML immediately so that the sending process can
    > continue.

    Hmm, you obviously know the situation on the ground better, but in most cases it is useful to insist that the HTTP submitting client parse the HTTP return status from the server, and if the status was anything other than an HTTP 200/OK, insist that it retry later on, or otherwise mark the delivery in error. This is about the only way plain HTTP can be made transactional - also, this is how the regular TN HTTP delivery agent works.

    The doThreadedInvoke and the Async processing are good ideas. Back in an early version of TN (IS 4 or 3.6), I found Async processing was problematic - but it should be fixed by now.


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


  • 8.  RE: Sending acknowledgement 200 http

    Posted Fri May 07, 2004 11:01 AM

    So I used the Service.doThreadInvoke( “namespace”, “servicename”, pipeline )

    It seems to work fine, but as I am not very familiar with threads,
    i got the following question:

    Are there performance issues to deal with?
    Do I have to explicitly end the thread? How do I do this?

    Kind regards,

    Wout


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


  • 9.  RE: Sending acknowledgement 200 http

    Posted Fri May 07, 2004 05:30 PM

    No Implication.
    The IS Controls the thread creation by “Server Thread Pool” Seting in resources.
    When the Service Ends execution it is released back to the Pool.

    -Ravi


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


  • 10.  RE: Sending acknowledgement 200 http

    Posted Sat May 08, 2004 02:56 PM

    See other posts here on WM Users about some exception handling approaches for services invoked on their own threads. What do you want to happen if an exception occurs on your process invoked on its own thread? Do you want to notify the user in any way?

    Mark


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


  • 11.  RE: Sending acknowledgement 200 http

    Posted Sun May 09, 2004 01:48 PM

    Nope, the user is not notified directly, but a stored procedure is called to update a table. An error code is logged to notify if the action is performed correctly.

    As time is an issue, we have chosen for the following solution:

    In stead of starting a new thread, we publish a document locally; in this way the 200 ok is send and the flow that has to be executed is subscribed on this document.

    The solution with the starting of a new thread, had some nasty side effects: When doin some load testing there were some threads that were never killed and at some points, new user sessions were opened and never closed…

    kind regards,

    Wout


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


  • 12.  RE: Sending acknowledgement 200 http

    Posted Sun May 09, 2004 11:34 PM

    Wout,

    I’ve used the Service.doThreadedInvoke() approach extensively on projects with great results. If you implement exception handling correctly, you won’t have orphaned threads or extraneous sessions. If you just invoke a service on its own thread without handling exceptions or managing sessions, you will get exactly what you were seeing. That is an implementation issue, not an issue with the architecture of the Integration Server.

    I’m glad you found a simple solution that would meet your requirements. Often, those are the very best kind.

    Mark

    (Message edited by mcarlson on May 09, 2004)


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


  • 13.  RE: Sending acknowledgement 200 http

    Posted Tue June 22, 2004 09:57 AM

    >> So I used the Service.doThreadInvoke( “namespace”, “servicename”, pipeline )
    >> It seems to work fine

    We are doing the exact same thing, but in the b2b 4.0.2 version. We are trying to asynchronously invoke a b2b service using the Service.doThreadInvoke.

    When we invoke the java service(containing the Service.doThreadInvoke), from our web client, the pipeline that is passed from the Java Service to the b2b Service has the two string inputs passed to it, but a node input is somehow becoming null. This node should contain the XML document submitted from the web client using the text/xml content type. We installed SP3 on the server, but it still has not fixed the problem.
    Any insights would be welcome.

    Thanks,
    Venkatesh


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