Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Integration JDBC inbound poller Java Based Configuration

I want to configure an Inbound pooler with Spring Integration JDBC. So far I have found xml configuration but I want to implement in java configuration.

I want to continuously check for changes in db table and I think this is achievable with Spring Integration JDBC.

My Db is in different Docker Container and my Application (Spring Boot) is in different Docker Container. I Can not use Hibernate Interceptor here because some other application will edit table.

like image 432
Umair Avatar asked Sep 06 '26 01:09

Umair


1 Answers

Not sure what resources have you investigated, but we have on first pages of our official Reference Manual this sample:

@Bean
@InboundChannelAdapter(value = "fooChannel", poller = @Poller(fixedDelay="5000"))
public MessageSource<?> storedProc(DataSource dataSource) {
    return new JdbcPollingChannelAdapter(dataSource, "SELECT * FROM foo where status = 0");
}

The chapter is called Finding Class Names for Java and DSL Configuration. So, should be as a good migration guide from XML configuration.

like image 151
Artem Bilan Avatar answered Sep 07 '26 14:09

Artem Bilan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!