JDBC Sample Polishing

- no need for DUMMY table
- max-rows-per-poll is deprecated
- set reply-timeout to 0 (for no person result)
This commit is contained in:
Gary Russell
2018-11-24 11:39:03 -05:00
parent ca8704265c
commit c868afb039
2 changed files with 5 additions and 9 deletions

View File

@@ -22,32 +22,29 @@
<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"/>
reply-timeout="0"/>
<int:method name="findPersonByName"
request-channel="findPersonRequestChannel"
request-timeout="5000"
reply-channel="findPersonReplyChannel"
reply-timeout="5000"/>
reply-timeout="0"/>
</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">
max-rows="100">
</int-jdbc:outbound-gateway>
<bean id="personResultMapper" class="org.springframework.integration.samples.jdbc.domain.PersonMapper"/>
<int-jdbc:outbound-gateway data-source="datasource"
request-channel="createPersonRequestChannel"
reply-channel="createPersonReplyChannel"

View File

@@ -1,6 +1,5 @@
create table IF NOT EXISTS USERS(USERNAME varchar(100),PASSWORD varchar(100), EMAIL varchar(100));
create table IF NOT EXISTS DUMMY(DUMMY_VALUE varchar(10));
create table IF NOT EXISTS Person(id integer identity primary key , name varchar(100), gender varchar(1), dateOfBirth date);
INSERT INTO USERS(USERNAME, PASSWORD, EMAIL) VALUES ('a', 'secret', 'spring-integration@awesome.com');
INSERT INTO USERS(USERNAME, PASSWORD, EMAIL) VALUES ('b', 's3cr3t', 'spring@rocks.com');
INSERT INTO USERS(USERNAME, PASSWORD, EMAIL) VALUES ('foo', 'bar', 'foo@bar.de');
INSERT INTO USERS(USERNAME, PASSWORD, EMAIL) VALUES ('foo', 'bar', 'foo@bar.de');