if (isExpectReply()) {
pattern = ExchangePattern.InOut;
} else {
pattern = ExchangePattern.InOnly;
}
Exchange inExchange = new SpringIntegrationExchange(getCamelContext(), pattern);
SpringIntegrationBinding.storeToCamelMessage(request, inExchange.getIn());
Exchange outExchange = getCamelTemplate().send(getCamelEndpointUri(), inExchange);
Message response = null;
if (isExpectReply()) {
response = SpringIntegrationBinding.storeToSpringIntegrationMessage(outExchange.getOut());
}