4 Replies Latest reply on Mar 5, 2013 5:52 PM by mataratones

    Async redirect

    mataratones

      I'm using this guide to receive a message into an ESB, send it asynchronously to two outside services, aggregate the responses, and return it.  The first part of it works -- it listens on an HttpGateway, calls the outside services asynchronously and returns the responses to the same ESB service.  However, I am unable to get them back to the original sender.

       

      Say the message comes in on Queue_A.  I set the To: field in the message header to Queue_A_reply, but it times out after I call CourierUtil.deliverMessage(message).  I was wondering if this could have anything to do with the HttpGateway, which I understand is inherently synchronous and may not play well as a OneWay service.  (I realize I could make it asynchronous in theory, but I can't return an HTTP 200 response to the client -- I have to return the results.)

       

      I would appreciate any feedback or suggestions.

       

      Derek

        • 1. Re: Async redirect
          tcunning

          Can you give us some more information (jboss-esb.xml, action that you're using to set the http response)?

          1 of 1 people found this helpful
          • 2. Re: Async redirect
            mataratones

            Well, I guess that's the crux of it:  do I need to set the HTTP response manually?  If it comes in through an HTTP gateway with mep=RequestResponse, the ESB takes care of formatting the final message into a proper HTTP response.  I'm not clear what happens if I set the mep=OneWay.  Based on the way the example cited in my first post, I thought I could set the message ReplyTo back to the original ReplyTo and it would work like a RequestResponse queue.  But I may be misunderstanding how that works.  Is there a way to get a message back out an HTTPGateway if it is set as OneWay?

            • 3. Re: Async redirect
              kconner

              The HTTP gateway will initialise the incoming message with a ReplyTo EPR; this is separate from the definition of 'mep' within your services (they reflect the impementation rather than the client's view).  You should be able to use the gateway's ReplyTo EPR to deliver the response from your last service.

               

              If you can upload an example project showing what you are trying then we can help out.

              • 4. Re: Async redirect
                mataratones

                Sorry for not responding.  Although I haven't figured out my issue, my colleague has been able to get it working, so I will not pursue this matter further at the moment.