1 Reply Latest reply on Feb 18, 2013 8:04 AM by raghav.vis

    how to call syncronous webservice in a esb queue

    jaigates

      i want my webservices to be called via many clients. To handle load i am planning to register this webservice in a esb queue and inform clients to call via esb client.

      To achieve this for every request i place on the queue i require a request id which which i can check whether the process is completed and output is ready. Once it is completed i need to use this request id and obtain real webservice output.

      pls let me know how to acheive this. Also share some link which has samples for the same.

        • 1. Re: how to call syncronous webservice in a esb queue
          raghav.vis

          Hello Jaigates Vg,

          Let us take your requirement step by step. If my understanding of your system is right then, the following would be the major interaction points.

          1. A Webservice exposed to clients to receive request.(You have Suggested that load is high).

          2. A queue is used at the other end of the webservice which lines up the requests for processing.

          3. A business object listens to the queue to process the data on the queue.

          4. The business object processes the request and forms a response object.

          5. A request ID which is unique - needed for checking whether output is ready. (Not Sure If I really understood what that means.. )

          6. Request ID also used to get the real-webservice-output.

          Let us take one point at a time and see how this can be handled.

          1. A webservice needs to be generated such that the operation accepts the input data of the required type.

               1. The web service must return an Unique ID which needs to be generated for every request.Do not rely on JMS Message ID or JMS Correlation ID. Consider using one of many third party API's for Key generation.

          2. The request can be sent to queue using QueueSender API or N+ java steps in obtaining Connection factory and so -on. I am not Sure if JMSRouter would be of any help as the transaction is of Request-Response type.

          3. A listener configured for the queue, Processes the data and makes the response available. (JMS Listener Service-Action).

          4. A Store needs to be configured such that the response object is persisted along with the Request ID as the Key.

          5. When ever the client comes back to check for a given request ID (for which I believe there is a web service generated whose operations takes in Request ID as an argument and returns the corresponding Response Object).

          Now Regarding the Load on the system,

          1. Clustering is an efficient mechanism when coupled with effective Load balancers would handle 100's of transactions at ease.

          2. Queue need not be used just for load issues. They need to be used only when you need a transaction to be asynchronous - Meaning the client need not hang on till the processing has been completed.More or less like a Session open to Shop for a book need not be alive till a book is delivered at home. The statuses can be tracked and updated with efficient scheduling mechanisms.

           

          Do let us have more insights as to how your response model needs to be as your last few lines does not provide us great insights.And do revert if you have any questions.

          Regards,

          Raghav V.