Results 1 to 6 of 6

Thread: JDBC Gateway - Thoughts

  1. #1
    Join Date
    May 2009
    Posts
    18

    Default JDBC Gateway - Thoughts

    The introduction of the inbound and outbound jdbc adapters to Spring Integration 2.0 are a great addition. As i was working with these adapters, i began to feel like there should be a jdbc gateway adapter (bi-directional). I can think of a many scenarious where we would want to include jdbc access in the middle of a unidirectional flow.


    The use case is:
    1. Inbound JMS adapter -> Payload contains keys (sent to "key" channel)
    2. jdbc-gateway wired to inbound channel ("key" channel), retrieves object payload using key and outputs the full message on an output channel
    3. outbound jdbc adapter writes to target database

    Note: i can always use a service activator to accomplish the same functionality but it would be much simpler to have a full pallet of jdbc adapter functionality.

    I could be missing something basic, so i'd would appreciate any feedback/thoughts.


    Thanks,
    Brian

  2. #2
    Join Date
    May 2007
    Location
    Netherlands
    Posts
    614

    Default

    I think what you describe is what Hohpe calls Claim Check. Am I right?

  3. #3
    Join Date
    May 2009
    Posts
    18

    Default

    iwein,
    it is exatcly that behavior. but i always saw the idiom for the claim check pattern to be a more formal "ticketing" strategy provided by the integration layer. For example, in the claim check you would typically pass a message to some component and would persist the message and hand you back a formal claim ticket.

    In my case, i would want to enrich the "key" message by obtaining the full payload before using the claim check to store the message and get a formal claim ticket.

    I was using the service activator as a way to make a database call in the middle of a process flow.

    Let me know if that makes sense.
    Brian

  4. #4
    Join Date
    May 2009
    Posts
    18

    Default

    To simplify the discussion, should there be a jdbc adapter (gateway) that can be used mid stream (not at the begining or end of a process) in a process flow?

    thx

  5. #5
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    I guess it's aguable whether this should be called a "gateway" or just a "service activator" where the service happens to be in a generic form (SQL query). In either case I can see how the framework could add value here - making something completely declarative where otherwise it would have required some (trivial) JDBC coding. We could combine the code from jdbc-inbound- and -outbound- adapters to implement this quite easily. If it is a framework feature, my vote would be for "jdbc-outbound-gateway".

    Another use case is to do an insert from the data in the input channel (as per the existing outbound adapter), and respond with the result of a select in the output channel (e.g. picking up a generated primary key).

  6. #6
    Join Date
    May 2009
    Posts
    18

    Default

    Thanks for the reponse. I created a JIRA ticket for this enhancement: https://jira.springsource.org/browse/INT-1327
    Last edited by dussab; Aug 3rd, 2010 at 07:47 AM.

Tags for this Thread

Posting Permissions

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