JDBC: requires-reply="false"

Default was changed to true some time ago, but the sample wasn't updated.
This commit is contained in:
Gary Russell
2018-11-24 10:39:13 -05:00
parent 7f3c7dd3e4
commit ca8704265c

View File

@@ -8,64 +8,65 @@
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
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<jdbc:embedded-database id="datasource" type="H2">
<jdbc:script location="classpath:setup-tables.sql"/>
</jdbc:embedded-database>
<!-- See also:
http://static.springsource.org/spring-integration/reference/htmlsingle/#gateway-proxy
http://www.eaipatterns.com/MessagingGateway.html -->
<int:channel id="createPersonRequestChannel"/>
<int:channel id="createPersonReplyChannel"/>
<int:channel id="findPersonRequestChannel"/>
<int:channel id="findPersonReplyChannel"/>
<int:gateway id="personService" service-interface="org.springframework.integration.samples.jdbc.service.PersonService">
<int:method name="createPerson"
request-channel="createPersonRequestChannel"
request-timeout="5000"
reply-channel="createPersonReplyChannel"
reply-timeout="5000"/>
<int:method name="findPersonByName"
request-channel="findPersonRequestChannel"
request-timeout="5000"
reply-channel="findPersonReplyChannel"
reply-timeout="5000"/>
</int:gateway>
<jdbc:embedded-database id="datasource" type="H2">
<jdbc:script location="classpath:setup-tables.sql"/>
</jdbc:embedded-database>
<!-- See also:
http://static.springsource.org/spring-integration/reference/htmlsingle/#gateway-proxy
http://www.eaipatterns.com/MessagingGateway.html -->
<int:channel id="createPersonRequestChannel"/>
<int:channel id="createPersonReplyChannel"/>
<int:channel id="findPersonRequestChannel"/>
<int:channel id="findPersonReplyChannel"/>
<int:gateway id="personService" service-interface="org.springframework.integration.samples.jdbc.service.PersonService">
<int:method name="createPerson"
request-channel="createPersonRequestChannel"
request-timeout="5000"
reply-channel="createPersonReplyChannel"
reply-timeout="5000"/>
<int:method name="findPersonByName"
request-channel="findPersonRequestChannel"
request-timeout="5000"
reply-channel="findPersonReplyChannel"
reply-timeout="5000"/>
</int:gateway>
<int-jdbc:outbound-gateway data-source="datasource"
requires-reply="false"
update="UPDATE DUMMY SET DUMMY_VALUE='test'"
request-channel="findPersonRequestChannel"
query="select * from Person where lower(name)=lower(:payload)"
reply-channel="findPersonReplyChannel" row-mapper="personResultMapper"
max-rows-per-poll="100">
</int-jdbc:outbound-gateway>
<int-jdbc:outbound-gateway data-source="datasource"
update="UPDATE DUMMY SET DUMMY_VALUE='test'"
request-channel="findPersonRequestChannel"
query="select * from Person where lower(name)=lower(:payload)"
reply-channel="findPersonReplyChannel" row-mapper="personResultMapper"
max-rows-per-poll="100">
</int-jdbc:outbound-gateway>
<bean id="personResultMapper" class="org.springframework.integration.samples.jdbc.domain.PersonMapper"/>
<int-jdbc:outbound-gateway data-source="datasource"
<int-jdbc:outbound-gateway data-source="datasource"
request-channel="createPersonRequestChannel"
reply-channel="createPersonReplyChannel"
update="insert into Person (name,gender,dateOfBirth)
update="insert into Person (name,gender,dateOfBirth)
values
(:name,:gender,:dateOfBirth)"
query="select * from Person where id = :id"
query="select * from Person where id = :id"
request-sql-parameter-source-factory="requestSource"
reply-sql-parameter-source-factory="replySource"
row-mapper="personResultMapper"
keys-generated="true"/>
<bean id="replySource" class="org.springframework.integration.jdbc.ExpressionEvaluatingSqlParameterSourceFactory">
<property name="parameterExpressions">
<map>
<entry key="id" value="#this['SCOPE_IDENTITY()']"/>
<entry key="id" value="#this['SCOPE_IDENTITY()']"/>
</map>
</property>
</bean>
</bean>
<bean id="requestSource" class="org.springframework.integration.jdbc.ExpressionEvaluatingSqlParameterSourceFactory">
<property name="parameterExpressions">
@@ -75,6 +76,6 @@
<entry key="dateOfBirth" value="payload.dateOfBirth"/>
</map>
</property>
</bean>
</bean>
</beans>