|
5 | 5 | xmlns:int="http://www.springframework.org/schema/integration"
|
6 | 6 | xmlns:jdbc="http://www.springframework.org/schema/jdbc"
|
7 | 7 | xmlns:int-jdbc="http://www.springframework.org/schema/integration/jdbc"
|
8 |
| - xmlns:context="http://www.springframework.org/schema/context" |
9 | 8 | xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
|
10 | 9 | http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
|
11 | 10 | http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
12 |
| - http://www.springframework.org/schema/integration/jdbc http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd |
13 |
| - http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> |
| 11 | + http://www.springframework.org/schema/integration/jdbc http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd"> |
14 | 12 |
|
15 |
| - <jdbc:embedded-database id="dataSource" type="DERBY" /> |
| 13 | + <jdbc:embedded-database id="dataSource" type="H2" /> |
16 | 14 |
|
17 | 15 | <jdbc:initialize-database data-source="dataSource">
|
18 |
| - <jdbc:script location="${int.schema.script}" /> |
| 16 | + <jdbc:script location="org/springframework/integration/jdbc/schema-h2.sql" /> |
19 | 17 | </jdbc:initialize-database>
|
20 | 18 |
|
21 | 19 | <int-jdbc:message-store id="messageStore" data-source="dataSource" />
|
22 | 20 |
|
23 |
| - <channel id="input" xmlns="http://www.springframework.org/schema/integration"> |
24 |
| - <queue ref="queue"/> |
25 |
| - </channel> |
26 |
| - |
27 |
| - <int:channel id="output"/> |
28 |
| - |
29 |
| - <int:logging-channel-adapter channel="output"/> |
| 21 | + <int:channel id="input"> |
| 22 | + <int:queue ref="queue"/> |
| 23 | + </int:channel> |
30 | 24 |
|
31 | 25 | <bean id="queue" class="org.springframework.integration.store.MessageGroupQueue">
|
32 | 26 | <constructor-arg ref="messageStore" />
|
33 | 27 | <constructor-arg value="JdbcMessageStoreChannelTests" />
|
34 | 28 | </bean>
|
35 | 29 |
|
36 |
| - <service-activator id="service-activator" input-channel="input" output-channel="output" xmlns="http://www.springframework.org/schema/integration"> |
| 30 | + <int:service-activator id="service-activator" input-channel="input" output-channel="nullChannel"> |
37 | 31 | <beans:bean class="org.springframework.integration.jdbc.store.JdbcMessageStoreChannelTests$Service" />
|
38 |
| - <poller fixed-rate="2000"> |
39 |
| - <transactional /> |
40 |
| - </poller> |
41 |
| - </service-activator> |
42 |
| - |
43 |
| - <context:property-placeholder location="int-${ENVIRONMENT:derby}.properties" |
44 |
| - system-properties-mode="OVERRIDE" |
45 |
| - ignore-unresolvable="true" |
46 |
| - order="1"/> |
| 32 | + <int:poller fixed-rate="2000"> |
| 33 | + <int:transactional synchronization-factory="transactionSynchronizationFactory"/> |
| 34 | + </int:poller> |
| 35 | + </int:service-activator> |
| 36 | + |
| 37 | + <int:transaction-synchronization-factory id="transactionSynchronizationFactory"> |
| 38 | + <int:after-commit expression="@afterCommitLatch.countDown()"/> |
| 39 | + </int:transaction-synchronization-factory> |
| 40 | + |
| 41 | + <bean id="afterCommitLatch" class="java.util.concurrent.CountDownLatch"> |
| 42 | + <constructor-arg value="1"/> |
| 43 | + </bean> |
47 | 44 |
|
48 | 45 | <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
|
49 | 46 | <property name="dataSource" ref="dataSource" />
|
|
0 commit comments