Results 1 to 4 of 4

Thread: Rest service composition?

  1. #1
    Join Date
    Mar 2005
    Posts
    144

    Question Rest service composition?

    All,

    I am fairly new to SI and would like to know if synchronous service composition is one of the patterns that SI supports. I have seen documentation on splitting/aggregation, but I have not come across information on aggregating services.

    In this situation, I need to call service A and service B using related, but slightly different information and then aggregate and return the result.

    It looks like I can roll my own by making two sync. calls using Springs rest template and then doing the aggregation afterward. Is this a use case that SI also supports? I would like to reuse the timeout functionality in the http gateway. Looking at the rest template, it doesn't look like there is an option to time out.

    Thanks!

  2. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    It sounds like it could be implemented as 1) publish-subscribe-channel 2) the two consumers that make the REST calls and 3) an aggregator. If you want the calls to be executed concurrently, you can provide a task-executor to the publish-subscribe-channel, or if you want to keep everything within a single transaction, then you can let them execute sequentially (by relying on the default where the same thread will execute both).

  3. #3
    Join Date
    Mar 2005
    Posts
    144

    Default send and receive?

    Mark,

    If I use a publish-subscribe-channel with a task executor (so both calls are executed concurrently), followed by an aggregator, the overall flow (pub-sub -> aggregator) will be executed synchronously, correct? Though it would be nice for both rest calls to be executed concurrently, I still need to do this work within a method call that has a return parameter.

    Would this work as I expect?

  4. #4
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Yes, they would be executed synchronously unless you provide an explicit "task-executor" on the publish-subscribe-channel.

Posting Permissions

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