Announcement Announcement Module
No announcement yet.
Handling Multiple Calls to JDBC-OutboundGateway Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Handling Multiple Calls to JDBC-OutboundGateway


    I have a scenario where I am calling two different legacy systems (IBM Mainframe & DB2). I just want to ensure I am using effective way in spring integration implementation. Please see my scenario below

    <!-- IBM Mainframe Call Chain -->
    <int:chain input-channel="XXXInputChannel"

    <int-ws:outbound-gateway uriXXX....>

    <!-- End of IBM Mainframe call -->

    <!--JDBC Call -->
    <int:chain input-channel="XXXOutputChannel" output-channel="XXXOtherOutputChannel">
    <int-jdbc:outbound-gateway ...>
    <!-- End of JDBC Call -->

    What I want to do is,

    Output of first chain (IBM mainframe call) will return a collection of objects (ArrayList), and I need to make multiple JDBC (second chain) calls as many times of the objects in the collection and I need to aggregate responses of this JDBC chain responses.

    Please advice right way of doing it.

    Ashok Gudise

  • #2
    When posting code/config, please use [ code ] ... [ /code ] tags (no spaces in brackets).

    Add a <splitter/> before the gateway (the default splitter will simply split any Collection into a separate message for each part). Follow the outbound-gateway with an <aggregator/>; it will comnbine the results into a List of results.

    You don't need any special correlation or release strategies for this simple use case, the default strategies will work.


    • #3
      Thanks Garry, I was initially decided to use Splitter-Aggregator pattern, but I mis-understood that I may need to go with splitter only when I need to differentiate among heterogeneous message types.
      Thanks I will go ahead with Splitter - Aggregator pattern.

      Ashok G


      • #4
        Not at all; in fact for a list of heterogeneous types, you'd need some additional custom code (or payload type routers etc). For this simple case, the simplest <splitter/> and <aggregator/> will work for you.