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

SpringXD and Integration: Bridge, polleable &subscribable channels

我正在阅读 Spring 集成文档以弄清楚如何使用 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 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 - Deployment status for stream 'source-customBridge-sink-testing': DeploymentStatus{state=failed,error(s)=org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.sprin gframework.integration.config.ConsumerEndpointFactoryBean#0': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: A poller should not be specified for endpoint 'org.springframework.integration.config.ConsumerEndpointFactoryBean#0', since 'pollable' is a Subscrib.

我错过了什么?

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

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