@Nullable protected Object receive() { this.initializeIfNecessary(); MessageChannel channel = getReplyChannel(); Assert.state(channel != null && (channel instanceof PollableChannel), "receive is not supported, because no pollable reply channel has been configured"); return this.messagingTemplate.receiveAndConvert(channel, Object.class); }
@Nullable protected Object receive(long timeout) { this.initializeIfNecessary(); MessageChannel channel = getReplyChannel(); Assert.state(channel != null && (channel instanceof PollableChannel), "receive is not supported, because no pollable reply channel has been configured"); return this.messagingTemplate.receiveAndConvert(channel, timeout); }
public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("siia/jms/gateways.xml"); MessageChannel toJMS = context.getBean("toJMS", MessageChannel.class); PollableChannel jmsReplies = context.getBean("jmsReplies", PollableChannel.class); MessagingTemplate template = new MessagingTemplate(); template.convertAndSend(toJMS, "echo"); Object response = template.receiveAndConvert(jmsReplies); System.out.println("response: " + response); }
public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("siia/jms/channel-adapters.xml"); MessageChannel toJMS = context.getBean("toJMS", MessageChannel.class); PollableChannel fromJMS = context.getBean("fromJMS", PollableChannel.class); MessagingTemplate template = new MessagingTemplate(); template.convertAndSend(toJMS, "echo"); Object response = template.receiveAndConvert(fromJMS); System.out.println("response: " + response); }
@Nullable protected Object receive() { this.initializeIfNecessary(); MessageChannel channel = getReplyChannel(); Assert.state(channel != null && (channel instanceof PollableChannel), "receive is not supported, because no pollable reply channel has been configured"); return this.messagingTemplate.receiveAndConvert(channel, Object.class); }
@Nullable protected Object receive(long timeout) { this.initializeIfNecessary(); MessageChannel channel = getReplyChannel(); Assert.state(channel != null && (channel instanceof PollableChannel), "receive is not supported, because no pollable reply channel has been configured"); return this.messagingTemplate.receiveAndConvert(channel, timeout); }