Split MessageSource types into 2 sub-interfaces: PollableSource and SubscribableSource. The MessageChannel hierarchy has also been revised accordingly. DirectChannel and PublishSubscribeChannel are now SubscribableSources, while the other queue-based channels are PollableSources. The PollableChannel interface extends BlockingSource which in turn is an extension of PollableSource that adds timeout-aware methods.

This commit is contained in:
Mark Fisher
2008-07-30 20:48:00 +00:00
parent 759b5f6d0e
commit fa58dc9457
77 changed files with 422 additions and 497 deletions

View File

@@ -20,6 +20,7 @@ import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.channel.ChannelRegistry;
import org.springframework.integration.channel.MessageChannel;
import org.springframework.integration.channel.PollableChannel;
import org.springframework.integration.config.MessageBusParser;
import org.springframework.integration.message.StringMessage;
@@ -34,7 +35,7 @@ public class HelloWorldDemo {
AbstractApplicationContext context = new ClassPathXmlApplicationContext("helloWorldDemo.xml", HelloWorldDemo.class);
ChannelRegistry channelRegistry = (ChannelRegistry) context.getBean(MessageBusParser.MESSAGE_BUS_BEAN_NAME);
MessageChannel inputChannel = channelRegistry.lookupChannel("inputChannel");
MessageChannel outputChannel = channelRegistry.lookupChannel("outputChannel");
PollableChannel outputChannel = (PollableChannel) channelRegistry.lookupChannel("outputChannel");
inputChannel.send(new StringMessage("World"));
System.out.println(outputChannel.receive().getPayload());
}