|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<beans xmlns="http://www.springframework.org/schema/beans" |
| 3 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 4 | + xmlns:int="http://www.springframework.org/schema/integration" |
| 5 | + xmlns:int-mongodb="http://www.springframework.org/schema/integration/mongodb" |
| 6 | + xmlns:mongo="http://www.springframework.org/schema/data/mongo" |
| 7 | + xmlns:tx="http://www.springframework.org/schema/tx" |
| 8 | + xsi:schemaLocation="http://www.springframework.org/schema/data/mongo http://www.springframework.org/schema/data/mongo/spring-mongo.xsd |
| 9 | + http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd |
| 10 | + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd |
| 11 | + http://www.springframework.org/schema/integration/mongodb http://www.springframework.org/schema/integration/mongodb/spring-integration-mongodb.xsd |
| 12 | + http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"> |
| 13 | + |
| 14 | + <mongo:db-factory id="mongoDbFactory" dbname="test" /> |
| 15 | + |
| 16 | + <int-mongodb:inbound-channel-adapter id="mongoInboundAdapter" |
| 17 | + channel="replyChannel" |
| 18 | + query="{'name' : 'Bob'}" |
| 19 | + entity-class="java.lang.Object" |
| 20 | + auto-startup="false"> |
| 21 | + <int:poller fixed-rate="100" /> |
| 22 | + </int-mongodb:inbound-channel-adapter> |
| 23 | + |
| 24 | + <int-mongodb:inbound-channel-adapter id="mongoInboundAdapterNamedFactory" |
| 25 | + mongodb-factory="mongoDbFactory" |
| 26 | + channel="replyChannel" |
| 27 | + query="{'name' : 'Bob'}" |
| 28 | + auto-startup="false"> |
| 29 | + <int:poller fixed-rate="5000" /> |
| 30 | + </int-mongodb:inbound-channel-adapter> |
| 31 | + |
| 32 | + <int-mongodb:inbound-channel-adapter id="mongoInboundAdapterWithTemplate" |
| 33 | + channel="replyChannel" |
| 34 | + mongo-template="mongoDbTemplate" |
| 35 | + query="{'name' : 'Bob'}" |
| 36 | + expect-single-result="true" |
| 37 | + entity-class="org.springframework.integration.mongodb.rules.MongoDbAvailableTests.Person" |
| 38 | + auto-startup="false"> |
| 39 | + <int:poller fixed-rate="5000" /> |
| 40 | + </int-mongodb:inbound-channel-adapter> |
| 41 | + |
| 42 | + <int-mongodb:inbound-channel-adapter id="mongoInboundAdapterWithNamedCollection" |
| 43 | + channel="replyChannel" |
| 44 | + collection-name="foo" |
| 45 | + mongo-template="mongoDbTemplate" |
| 46 | + query="{'name' : 'Bob'}" |
| 47 | + entity-class="java.lang.Object" |
| 48 | + auto-startup="false"> |
| 49 | + <int:poller fixed-rate="5000" /> |
| 50 | + </int-mongodb:inbound-channel-adapter> |
| 51 | + |
| 52 | + <int-mongodb:inbound-channel-adapter id="mongoInboundAdapterWithNamedCollectionExpression" |
| 53 | + channel="replyChannel" |
| 54 | + collection-name-expression="'foo'" |
| 55 | + mongo-template="mongoDbTemplate" |
| 56 | + query="{'name' : 'Bob'}" |
| 57 | + entity-class="java.lang.Object" |
| 58 | + auto-startup="false"> |
| 59 | + <int:poller fixed-rate="5000" /> |
| 60 | + </int-mongodb:inbound-channel-adapter> |
| 61 | + |
| 62 | + <int-mongodb:inbound-channel-adapter id="inboundAdapterWithOnSuccessDisposition" |
| 63 | + channel="replyChannel" |
| 64 | + query="{'name' : 'Bob'}" |
| 65 | + auto-startup="false"> |
| 66 | + |
| 67 | + <int:poller fixed-rate="200" max-messages-per-poll="1"> |
| 68 | + <int:advice-chain synchronization-factory="syncFactory"> |
| 69 | + <bean |
| 70 | + class="org.springframework.integration.mongodb.config.MongoDbInboundChannelAdapterIntegrationTests.TestMessageSourceAdvice" /> |
| 71 | + <tx:advice> |
| 72 | + <tx:attributes> |
| 73 | + <tx:method name="*" /> |
| 74 | + </tx:attributes> |
| 75 | + </tx:advice> |
| 76 | + </int:advice-chain> |
| 77 | + </int:poller> |
| 78 | + </int-mongodb:inbound-channel-adapter> |
| 79 | + |
| 80 | + <int:transaction-synchronization-factory id="syncFactory"> |
| 81 | + <int:after-commit expression="@documentCleaner.remove(#mongoTemplate, payload, headers.mongo_collectionName)" /> |
| 82 | + </int:transaction-synchronization-factory> |
| 83 | + |
| 84 | + <int-mongodb:inbound-channel-adapter id="mongoInboundAdapterWithConverter" |
| 85 | + channel="replyChannel" |
| 86 | + query="{'name' : 'Bob'}" |
| 87 | + entity-class="java.lang.Object" |
| 88 | + mongo-converter="mongoConverter" |
| 89 | + auto-startup="false"> |
| 90 | + <int:poller fixed-rate="100" /> |
| 91 | + </int-mongodb:inbound-channel-adapter> |
| 92 | + |
| 93 | + <bean id="documentCleaner" |
| 94 | + class="org.springframework.integration.mongodb.config.MongoDbInboundChannelAdapterIntegrationTests.DocumentCleaner" /> |
| 95 | + |
| 96 | + <bean id="mongoDbTemplate" class="org.springframework.data.mongodb.core.MongoTemplate"> |
| 97 | + <constructor-arg ref="mongoDbFactory" /> |
| 98 | + </bean> |
| 99 | + |
| 100 | + <bean id="mongoConverter" |
| 101 | + class="org.springframework.integration.mongodb.rules.MongoDbAvailableTests.TestMongoConverter"> |
| 102 | + <constructor-arg ref="mongoDbFactory" /> |
| 103 | + <constructor-arg> |
| 104 | + <bean class="org.springframework.data.mongodb.core.mapping.MongoMappingContext" /> |
| 105 | + </constructor-arg> |
| 106 | + </bean> |
| 107 | + |
| 108 | + <int:channel id="replyChannel"> |
| 109 | + <int:queue /> |
| 110 | + </int:channel> |
| 111 | + |
| 112 | + <bean id="transactionManager" class="org.springframework.integration.transaction.PseudoTransactionManager" /> |
| 113 | + |
| 114 | +</beans> |
0 commit comments