Spring Integration JDBC inbound poller Java Based Configuration

北城余情 提交于 2020-01-02 07:35:10

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/52327533/spring-integration-jdbc-inbound-poller-java-based-configuration

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!