Reorder beans in JdbcPollingChAParserTests cofigs

https://build.spring.io/browse/INT-AT42SIO-820/

The test configs use `fixed-rate="100"`.
This way when Inbound Channel Adapter is declared earlier in the
config than `<jdbc:embedded-database>`, there is a chance that we start
to poll DB before it is really initialized.

* Reorder config so embedded DB is initialized before an
Inbound Channel Adapter

**Cherry-pick to 5.0.x, 4.3.x and 4.2.x**
This commit is contained in:
Artem Bilan
2018-03-26 11:07:36 -04:00
parent ae2aa8b6d1
commit da6f47cf40
9 changed files with 51 additions and 58 deletions

View File

@@ -9,12 +9,13 @@
http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/jdbc
http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd">
<si:message-history/>
<inbound-channel-adapter id="jdbcAdapter" query="select * from item where status=2" channel="target"
data-source="dataSource" />
<beans:import resource="jdbcInboundChannelAdapterCommonConfig.xml" />
<si:message-history/>
<inbound-channel-adapter id="jdbcAdapter" query="select * from item where status=2" channel="target"
data-source="dataSource" />
</beans:beans>

View File

@@ -1,20 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/integration/jdbc"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:si="http://www.springframework.org/schema/integration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/jdbc
http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd">
<beans:import resource="jdbcInboundChannelAdapterCommonConfig.xml" />
<inbound-channel-adapter channel="target" data-source="dataSource">
<query>select * from item where status=2</query>
<update>update item set status=10 where id in (:id)</update>
</inbound-channel-adapter>
<beans:import resource="jdbcInboundChannelAdapterCommonConfig.xml" />
</beans:beans>

View File

@@ -1,18 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/integration/jdbc"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:si="http://www.springframework.org/schema/integration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/jdbc
http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd">
<inbound-channel-adapter query="select * from item where status=2" channel="target"
data-source="dataSource" update="update item set status=10 where id in (:id)" />
<beans:import resource="jdbcInboundChannelAdapterCommonConfig.xml" />
<inbound-channel-adapter query="select * from item where status=2" channel="target"
data-source="dataSource" update="update item set status=10 where id in (:id)" />
</beans:beans>

View File

@@ -6,10 +6,11 @@
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration/jdbc
http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd">
<inbound-channel-adapter id="jdbcAdapter" query="select * from item where status=2" channel="target"
data-source="dataSource" auto-startup="#{systemProperties['autostart']?:false}"/>
<beans:import resource="jdbcInboundChannelAdapterCommonConfig.xml" />
<inbound-channel-adapter id="jdbcAdapter" query="select * from item where status=2" channel="target"
data-source="dataSource" auto-startup="#{systemProperties['autostart']?:false}"/>
</beans:beans>

View File

@@ -1,18 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/integration/jdbc"
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:si="http://www.springframework.org/schema/integration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/jdbc
http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd">
<inbound-channel-adapter query="select * from item where status=2"
channel="target" jdbc-operations="jdbcTemplate" />
<beans:import resource="jdbcInboundChannelAdapterCommonConfig.xml"/>
<inbound-channel-adapter query="select * from item where status=2"
channel="target" jdbc-operations="jdbcTemplate"/>
<beans:import resource="jdbcInboundChannelAdapterCommonConfig.xml" />
</beans:beans>

View File

@@ -1,18 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/integration/jdbc"
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:si="http://www.springframework.org/schema/integration"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/jdbc
http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd">
<beans:import resource="jdbcInboundChannelAdapterCommonConfig.xml" />
<inbound-channel-adapter query="select * from item where status=2"
channel="target" data-source="dataSource" max-rows-per-poll="2"
update="update item set status=10 where id in (:id)" />
<beans:import resource="jdbcInboundChannelAdapterCommonConfig.xml" />
</beans:beans>

View File

@@ -1,32 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/integration/jdbc" xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:si="http://www.springframework.org/schema/integration" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
<beans:beans xmlns="http://www.springframework.org/schema/integration/jdbc"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/jdbc
http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd">
<inbound-channel-adapter query="select * from item where status=2" channel="target"
update="update item set status=1, name=:name where id in (:id)" jdbc-operations="jdbcTemplate"
update-sql-parameter-source-factory="sqlParameterSourceFactory" />
<beans:import resource="jdbcInboundChannelAdapterCommonConfig.xml"/>
<beans:import resource="jdbcInboundChannelAdapterCommonConfig.xml" />
<beans:bean id="sqlParameterSourceFactory" class="org.springframework.integration.jdbc.ExpressionEvaluatingSqlParameterSourceFactory">
<beans:bean id="sqlParameterSourceFactory"
class="org.springframework.integration.jdbc.ExpressionEvaluatingSqlParameterSourceFactory">
<beans:property name="parameterExpressions">
<beans:map>
<beans:entry key="name" value="'bar'.toUpperCase()" />
<beans:entry key="name" value="'bar'.toUpperCase()"/>
</beans:map>
</beans:property>
<beans:property name="staticParameters">
<beans:map>
<beans:entry key="foo" value="bar" />
<beans:entry key="foo" value="bar"/>
</beans:map>
</beans:property>
</beans:bean>
<inbound-channel-adapter query="select * from item where status=2" channel="target"
update="update item set status=1, name=:name where id in (:id)"
jdbc-operations="jdbcTemplate"
update-sql-parameter-source-factory="sqlParameterSourceFactory"/>
</beans:beans>

View File

@@ -1,20 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/integration/jdbc"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:si="http://www.springframework.org/schema/integration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/jdbc
http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd">
<inbound-channel-adapter query="select * from item where status=:status" channel="target"
data-source="dataSource" select-sql-parameter-source="parameterSource"/>
<beans:import resource="jdbcInboundChannelAdapterCommonConfig.xml" />
<beans:bean id="parameterSource" class="org.springframework.integration.jdbc.config.JdbcPollingChannelAdapterParserTests$TestSqlParameterSource"/>
<beans:bean id="parameterSource"
class="org.springframework.integration.jdbc.config.JdbcPollingChannelAdapterParserTests$TestSqlParameterSource"/>
<inbound-channel-adapter query="select * from item where status=:status" channel="target"
data-source="dataSource" select-sql-parameter-source="parameterSource"/>
</beans:beans>

View File

@@ -7,11 +7,12 @@
http://www.springframework.org/schema/integration/jdbc
http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd">
<beans:import resource="jdbcInboundChannelAdapterCommonConfig.xml"/>
<inbound-channel-adapter query="select * from item where status=:status" channel="target"
data-source="dataSource" select-sql-parameter-source="parameterSource"
update="delete from item"/>
<beans:import resource="jdbcInboundChannelAdapterCommonConfig.xml"/>
<beans:bean id="parameterSource" factory-bean="parameterSourceFactory"
factory-method="createParameterSourceNoCache">