List of usage examples for org.springframework.integration.support MessageBuilder setReplyChannel
@Override
public MessageBuilder<T> setReplyChannel(MessageChannel replyChannel)
From source file:nz.co.senanque.messaging.springintegration.MessageSenderImpl.java
public boolean send(T graph, long correlationId) { Object payload = graph;/* w ww. j av a2 s. c o m*/ if (m_marshaller != null) { Result result = m_resultFactory.createResult(graph); if (result == null) { throw new MessagingException("Unable to marshal payload, ResultFactory returned null."); } try { m_marshaller.marshal(graph, result); } catch (Exception e) { throw new WorkflowException("Failed to marshal payload", e); } Document doc = (Document) m_resultTransformer.transformResult(result); payload = doc; } MessageBuilder<?> messageBuilder = MessageBuilder.withPayload(payload); if (getReplyChannel() != null) { messageBuilder.setReplyChannel(getReplyChannel()); } if (getErrorChannel() != null) { messageBuilder.setErrorChannel(getErrorChannel()); } if (getMessagePriority() != null) { messageBuilder.setPriority(getMessagePriority()); } messageBuilder.setCorrelationId(correlationId); Message<?> ret = messageBuilder.build(); return getChannel().send(messageBuilder.build()); }