Spring集成jdbc oubound网关选择查询只返回一条记录

时间:2017-08-10 10:22:17

标签: spring-integration

我正在尝试使用spring integration jdbc outbound gateway从数据库中获取记录。我在数据库中有很多记录,但下面的代码只返回有效负载中的一条记录。

<int-jdbc:outbound-gateway
query="select * from payee"
request-channel="input"
reply-channel="output"
data-source="dataSource"/>

1 个答案:

答案 0 :(得分:0)

您必须使用max-rows-per-poll="0"

   <xsd:attribute name="max-rows-per-poll" type="xsd:string">
                    <xsd:annotation>
                        <xsd:documentation>
                            When using a select query, you can set a
                            custom limit regarding the number of rows
                            extracted. Otherwise by default only the first
                            row will be extracted into the outgoing message.

                            If set to '0' all rows are extracted.
                        </xsd:documentation>
                    </xsd:annotation>
                </xsd:attribute>