Announcement Announcement Module
Collapse
No announcement yet.
Rest service composition? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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).

    Comment


    • #3
      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?

      Comment


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

        Comment

        Working...
        X