PDA

View Full Version : A problem about the channel in the configure file?



lovepeculiar
Jan 25th, 2010, 03:57 AM
I rewrite a new QueueChannel like the spring integration, also extends the class AbstractPollableChannel,but now I don't know how to injection my own channel in the configrue file.somebody have the demos? thank you.

dturanski
Jan 27th, 2010, 07:15 AM
Just configure your channel as a regular spring bean:

<bean id="customChannel" class="...">
</bean>

and use it in any message handler, e.g.,

<si:bridge input-channel="customChannel" output-channel="someOtherChannel"/>

oleg.zhurakousky
Feb 1st, 2010, 09:55 AM
Why are you writing a queue channel?
There is one in Spring Integration


<channel id="myQueue">
<queue capacity="1000"/>
</channel>

Will create a queue channel which can hold up to 1000 messages. THen you can configure poller to extract messages from it.