Announcement Announcement Module
Collapse
No announcement yet.
SI and multiple clients Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SI and multiple clients

    Hi,

    I'm looking for a solution of the following use case:

    Multiple clients making requests to the server (based on SI components). Because the serverside processing will take some time, the server starts processing (droping the message to a request channel) and returns immediatly with an unique id (correlation id?). Each client will make a second request with the returned id to ask the server for the reply message.

    With one client I don't see any problems. But how can the server identify the correct response message with multiple clients?
    Are there any concepts in SI?

    Thanks,
    Thomas

  • #2
    There are several ways of handling it and yes we already have something like this in SI. If you are familiar with Messaging Gateway if you make several calls to a gateway method and reply messages might come in not necessarily in sequence Gateway has an internal reply correlator.
    Also with Spring Integration 2.0 we've introduced an Asynchronous Gateway http://static.springsource.org/sprin...#async-gateway which in the nutshell gives you exactly what you are describing and that is:
    1) immediate response (already correlated with the request)
    2) ability to wait for a reply

    Check it out and let us know if it satisfies your use case.

    Comment


    • #3
      Thanks Oleg for the fast reply!

      Will this also work for http gateways?

      ~Thomas

      Comment


      • #4
        Thomas

        Could you provide a little more details regarding your use case. I am trying to understand if you are asking about Inbound or Outbound Http Gateway?

        Comment


        • #5
          Hi Oleg,

          here the use case:

          A client makes a HTTP POST request to the server. At server-side there is a HTTP inbound gateway, which creates a message from the request payload and sends the message to a request channel. The HTTP request returns immediately with any kind of identifier. Now there are several processing components like converters, routers and service activators very similar to the cafe sample or your loan broker. In the mean time the client makes HTTP GET requests with the identifier as parameter until the response message will be available.

          ~Thomas

          PS: Sorry for my English.
          Last edited by Thomas Ziem; Jan 10th, 2011, 02:22 PM.

          Comment


          • #6
            Well, this is different then what I was proposing earlier.
            Let me make sure i understand you correctly first.

            You want one HTTP POST request to create a resource and the creation process might take undefined amount of time. So instead of waiting you want to be able to ping the server with the GET request and if the resource available, then get it. Is that correct?

            If so, then you can simply establish a contract where the resource identifier (e.g., Message id) generated during the POST request will be the identifier used to store the result of processing (e.g., RDBMS). Then you can use that same returned identifier to build process that checks if the resource is available providing that it will only be available if the first process finished.

            Is that what you are looking for?

            Comment


            • #7
              OK. Are there SI resources who can handle this (maybe something like a MessageStore)?

              You mentioned in a comment of INT-852 that you are working on part 2 of your loan broker sample. Are there any news?

              ~Thomas

              Comment

              Working...
              X