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