@Override
public void bindReplier(String name, final MessageChannel requests, MessageChannel replies,
Properties properties) {
validateConsumerProperties(name, properties, Collections.emptySet());
SubscribableChannel requestChannel = this.findOrCreateRequestReplyChannel("requestor." + name);
requestChannel.subscribe(new MessageHandler() {
@Override
public void handleMessage(Message<?> message) throws MessagingException {
requests.send(message);
}
});
// TODO: handle Pollable ?
Assert.isInstanceOf(SubscribableChannel.class, replies);
final SubscribableChannel replyChannel = this.findOrCreateRequestReplyChannel("replier." + name);
((SubscribableChannel) replies).subscribe(new MessageHandler() {
@Override
public void handleMessage(Message<?> message) throws MessagingException {
replyChannel.send(message);
}
});
}