Announcement Announcement Module
Collapse
No announcement yet.
JPA Retrieving Outbound Gateway produced no reply when zero entities in database Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

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

    Comment

    Working...
    X