简体   繁体   English

Spring Integration JDBC入站轮询器基于Java的配置

[英]Spring Integration JDBC inbound poller Java Based Configuration

I want to configure an Inbound pooler with Spring Integration JDBC. 我想用Spring Integration JDBC配置一个入站池。 So far I have found xml configuration but I want to implement in java configuration. 到目前为止,我已经找到了xml配置,但是我想在Java配置中实现。

I want to continuously check for changes in db table and I think this is achievable with Spring Integration JDBC. 我想不断检查数据库表中的更改,我认为这可以通过Spring Integration JDBC实现。

My Db is in different Docker Container and my Application (Spring Boot) is in different Docker Container. 我的Db在不同的Docker容器中,而我的应用程序(Spring Boot)在不同的Docker容器中。 I Can not use Hibernate Interceptor here because some other application will edit table. 我不能在这里使用Hibernate Interceptor,因为其他一些应用程序将编辑表。

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 . 本章称为“ Finding Class Names for Java and DSL Configuration So, should be as a good migration guide from XML configuration. 因此,应作为从XML配置迁移的良好指南。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM