2 Replies Latest reply on Mar 5, 2009 9:34 AM by Scott Dawson

    Async invocation over HTTP

    Scott Dawson Apprentice

      I'm looking for a way to invoke a service asynchronously from an HTTP client. I would like to configure the service with a OneWay MEP. Ideally, I'd like for the client to send in a chunk of XML and have the ESB respond immediately with an HTTP response with a status code of 202 (Accepted), indicating that processing has been initiated. I think that is consistent with the description of 202 in the HTTP/1.1 spec.

      I know how to use the jbr-provider to configure an HTTP gateway/listener, but as far as I can tell, the service MEP has to be RequestResponse. There's some code for a "synchronous" flag in the JBossRemotingGatewayListener but I wasn't able to successfully configure that on the listener or provider, so I'm not sure if that is helpful or not.

      Also, I know that work is in progress on a new HTTP (Tomcat) gateway/listener. That's not yet available in community version 4.5, is it? Will that replace the jbr-provider for HTTP connections?

      Thanks,
      Scott

        • 1. Re: Async invocation over HTTP
          Kevin Conner Master

          Setting synchronous to false should give you what you are after. What issues did you see when doing this?

          I believe it has to be defined using a property element and can be contained within the provider, bus or listener.

          Kev

          • 2. Re: Async invocation over HTTP
            Scott Dawson Apprentice

            Kev - Thanks, you're right. I was trying to configure it as an XML attribute.

            Here's the correct configuration:

            <jbr-listener name="httpGateway" busidref="http-1" is-gateway="true" >
             <property name="synchronous" value="false"/>
             <property name="asyncResponse" value="/asyncResp.xml"/>
            </jbr-listener>
            

            The asyncResponse property is optional and allows configuration of a file containing the HTTP response message. If you don't specify asyncResponse, the client will get an
            <ack/>


            Thanks again,
            Scott