Results 1 to 2 of 2

Thread: JPA Retrieving Outbound Gateway produced no reply when zero entities in database

Hybrid View

  1. #1
    Join Date
    Nov 2012
    Posts
    10

    Default JPA Retrieving Outbound Gateway produced no reply when zero entities in database

    If a JPA Retrieving Outbound Gateway is configured using entity-class and there are no entities in the database then it seems to produce no reply for the original request message. The log states:

    DEBUG o.s.i.j.outbound.JpaOutboundGateway - handler 'org.springframework.integration.jpa.outbound.JpaO utboundGateway@9fb4679' produced no reply for request Message
    I expected it to send a reply message with an empty list. Without this, it means the receiver (in my case another gateway) is just blocking waiting for a reply. Adding a timeout to the receiving gateway is unsatisfactory, because then how do I distinguish between a genuine database delay, and the use case where there are no entities in the database?

    Have I missed some config setting that resolves this?

    Thanks,
    Menno

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

    Default

    Looks like a bug to me - I believe that the gateway should, as you say, return an empty list if there are no results. A gateway should never behave this way.

    It gets a bit more tricky if 'expectSingleResult' is true (we can't return a null payload), so I suspect we'd have to return an empty list there too - but that's a bit messy because the result type will depend on the data. Maybe we'd have to throw an exception in that case.

    Please go ahead and create a JIRA ticket and we can start a dialog of how to fix the problem there.
    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
  •