Updated QuoteDemo to use an 'inbound-channel-adapter' XML element since the @Poller annoation is being removed.

This commit is contained in:
Mark Fisher
2008-11-25 19:40:31 +00:00
parent 69727ae8c4
commit 1f0104d6f8
2 changed files with 10 additions and 9 deletions

View File

@@ -18,18 +18,11 @@ package org.springframework.integration.samples.quote;
import java.util.Random;
import org.springframework.integration.annotation.ChannelAdapter;
import org.springframework.integration.annotation.MessageEndpoint;
import org.springframework.integration.annotation.Poller;
/**
* @author Mark Fisher
*/
@MessageEndpoint
public class TickerStream {
@ChannelAdapter("tickers")
@Poller(interval = 300)
public String nextTicker() {
char[] chars = new char[3];
for (int i = 0; i < 3; i++) {

View File

@@ -12,10 +12,18 @@
<annotation-config/>
<beans:bean class="org.springframework.integration.samples.quote.TickerStream"/>
<inbound-channel-adapter ref="tickerStream" method="nextTicker" channel="tickers">
<poller max-messages-per-poll="1">
<interval-trigger interval="300"/>
</poller>
</inbound-channel-adapter>
<beans:bean class="org.springframework.integration.samples.quote.QuoteService"/>
<channel id="tickers"/>
<stream:stdout-channel-adapter id="quotes" append-newline="true"/>
<beans:bean id="tickerStream" class="org.springframework.integration.samples.quote.TickerStream"/>
<beans:bean id="quoteService" class="org.springframework.integration.samples.quote.QuoteService"/>
</beans:beans>