Results 1 to 7 of 7

Thread: SI and multiple clients

  1. #1
    Join Date
    Jun 2008
    Location
    Berlin, Germany
    Posts
    46

    Default 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. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    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.

  3. #3
    Join Date
    Jun 2008
    Location
    Berlin, Germany
    Posts
    46

    Default

    Thanks Oleg for the fast reply!

    Will this also work for http gateways?

    ~Thomas

  4. #4
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    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?

  5. #5
    Join Date
    Jun 2008
    Location
    Berlin, Germany
    Posts
    46

    Default

    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 at 02:22 PM.

  6. #6
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    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?

  7. #7
    Join Date
    Jun 2008
    Location
    Berlin, Germany
    Posts
    46

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •