Removed the @MessageSource method-level annotation and added @Pollable as its replacement. Also added the @ChannelAdapter class-level annotation (refactoring to remove SourceEndpoint).
This commit is contained in:
@@ -22,11 +22,13 @@ import java.util.Random;
|
||||
|
||||
import org.springframework.integration.annotation.Handler;
|
||||
import org.springframework.integration.annotation.MessageEndpoint;
|
||||
import org.springframework.integration.annotation.Polled;
|
||||
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
@MessageEndpoint(input="tickers", output="quotes")
|
||||
@Polled(period=300)
|
||||
public class QuoteService {
|
||||
|
||||
@Handler
|
||||
|
||||
@@ -18,18 +18,16 @@ package org.springframework.integration.samples.quote;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.springframework.integration.annotation.MessageEndpoint;
|
||||
import org.springframework.integration.annotation.MessageSource;
|
||||
import org.springframework.integration.annotation.Polled;
|
||||
import org.springframework.integration.annotation.ChannelAdapter;
|
||||
import org.springframework.integration.annotation.Pollable;
|
||||
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
@MessageEndpoint(output="tickers")
|
||||
@Polled(period=300)
|
||||
@ChannelAdapter("tickers")
|
||||
public class TickerStream {
|
||||
|
||||
@MessageSource
|
||||
@Pollable
|
||||
public String nextTicker() {
|
||||
char[] chars = new char[3];
|
||||
for (int i = 0; i < 3; i++) {
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
|
||||
<annotation-driven/>
|
||||
|
||||
<channel id="tickers"/>
|
||||
|
||||
<beans:bean class="org.springframework.integration.samples.quote.TickerStream"/>
|
||||
|
||||
<beans:bean class="org.springframework.integration.samples.quote.QuoteService"/>
|
||||
|
||||
Reference in New Issue
Block a user