SpringXD和集成:桥接,可轮询和可订阅的渠道

时间:2017-03-16 20:32:23

标签: spring spring-integration spring-xd

我正在阅读Spring Integration文档,以了解如何使用polleable and subscribable channels建立桥接(这将是我的SpringXD模块之一)。

所以the documentation related to the bridge说基本上我应该这样做:

http://www.springframework.org/schema/beans/spring-beans.xsd         http://www.springframework.org/schema/integration         http://www.springframework.org/schema/integration/spring-integration.xsd“>

<channel id="pollable" />
<bridge input-channel="pollable" output-channel="subscribable">
    <poller max-messages-per-poll="10" fixed-rate="5000" />
</bridge>
<channel id="subscribable" />

然后我正在创建一个SpringXD Stream,如:

stream create source-customBridge-sink-testing --definition "kafka-source:kafka --zkconnect=localhost:2181 --topic=first-queue | custom-bridge | kafka-sink:kafka --topic=regular-queue" --deploy

但我得到了:

  

2017-03-16T12:52:06-0300 1.3.0.RELEASE INFO DeploymentSupervisor-0 zk.ZKStreamDeploymentHandler - 流'source-customBridge-sink-testing'的部署状态:DeploymentStatus {state = failed,error(s )= org.springframework.beans.factory.BeanCreationException:创建名为'org.sprin的bean时出错   gframework.integration.config.ConsumerEndpointFactoryBean#0':init方法的调用失败;嵌套异常是java.lang.IllegalArgumentException:不应为端点'org.springframework.integration.config.ConsumerEndpointFactoryBean#0'指定一个轮询器,因为'pollable'是一个Subscrib。

我错过了什么?

1 个答案:

答案 0 :(得分:2)

您遗漏的问题是pollable必须声明为:

<channel id="pollable">
    <queue/>
</channel>