Results 1 to 4 of 4

Thread: Handling Multiple Calls to JDBC-OutboundGateway

  1. #1
    Join Date
    Feb 2013
    Posts
    7

    Default Handling Multiple Calls to JDBC-OutboundGateway

    Hi

    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

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

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

    </int:chain>
    <!-- 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.


    Regards
    Ashok Gudise

  2. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,016

    Default

    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.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3
    Join Date
    Feb 2013
    Posts
    7

    Default

    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.

    Regards
    Ashok G

  4. #4
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,016

    Default

    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.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

Posting Permissions

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