Search code examples
springspring-integrationspring-xd

SpringXD and Integration: Bridge, polleable &subscribable channels


I'm reading the Spring Integration documentation to figure out how to implment a bridge with polleable and subscribable channels (which will be one of my SpringXD modules).

So the documentation related to the bridge says that basically, I should do something like:

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" />

Then I'm creating a SpringXD Stream like:

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

But I'm getting:

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.

What am I missing?


Solution

  • The problem that you are missing that the pollable must be declared as :

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