'Spring Integration Fetch SQL Data after the Flow starts

Have an integration flow which polls a JMS queue and for each message, using a field from the message data need to fire a SELECT query and then split the results from it for further processing.

How do I run a SELECT query in the mid of the flow using Java DSL? Tried with JdbcOutboundGateway and it is expecting the Poller object.

Thanks



Solution 1:[1]

The JdbcOutboundGateway is the correct way to solve your task. It does not require the poller. That's endpoint which is going to call this JdbcOutboundGateway expects the poller. Just because the input channel is a QueueChannel in your case. Not sure why would one need a queue just after a JMS queue...

Spring Integration model is like this:

channel -> endpoint (poller) -> message handler (-> channel)

Whatever is in the parentheses ? is optional and depend on the channel and message handler implementation, respectively.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Artem Bilan