diff --git a/spring-integration-core/src/main/java/org/springframework/integration/gateway/AbstractRemotingOutboundGateway.java b/spring-integration-core/src/main/java/org/springframework/integration/gateway/AbstractRemotingOutboundGateway.java index 1efd3f5464..67fbaa6c87 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/gateway/AbstractRemotingOutboundGateway.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/gateway/AbstractRemotingOutboundGateway.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,7 +60,8 @@ public abstract class AbstractRemotingOutboundGateway extends AbstractReplyProdu this.getClass().getName() + " expects a Serializable payload type " + "but encountered [" + message.getPayload().getClass().getName() + "]"); } - Message requestMessage = MessageBuilder.fromMessage(message).build(); + Message requestMessage = MessageBuilder.withPayload(message.getPayload()) + .copyHeaders(message.getHeaders()).build(); try { Message reply = this.proxy.exchange(requestMessage); if (reply != null) {