如何使用入站通道适配器轮询器解决异常?

时间:2018-07-19 14:48:43

标签: java spring spring-integration

找不到答案。
春季版本5.0.6。
我的配置:

<int:channel id="data"/>

<int:inbound-channel-adapter 
    id="dataAdapter"                                                                    
    channel="data"                                    
    auto-startup="false"
    ref="dataGetter"
    method="myMessageSource">
    <int:poller max-messages-per-poll="10"/>
</int:inbound-channel-adapter>
<beans:bean
    class="org.endpoints.DataGetter"
    id="dataGetter"/>

抛出异常:

Configuration problem: A <poller> must have one and only one trigger configuration.

如果没有轮询器:

No poller has been defined for channel-adapter 'dataAdapter', and no default poller is available within the context.

如何正确设置轮询器?

1 个答案:

答案 0 :(得分:1)

查看您的配置:

<int:poller max-messages-per-poll="10"/>

您不符合拥有fixed-delayfixed-ratecron或仅trigger引用的条件:https://docs.spring.io/spring-integration/docs/5.0.6.RELEASE/reference/html/messaging-endpoints-chapter.html#endpoint-namespace

相关问题