Repository: camel Updated Branches: refs/heads/camel-2.14.x f98158aa3 -> 9c84398e2 refs/heads/camel-2.15.x 0403f0666 -> a93c74c41
CAMEL-8674 Set remote UDP address in headers of camel-netty4 message Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d4fac456 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d4fac456 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d4fac456 Branch: refs/heads/camel-2.15.x Commit: d4fac456ef7fae0426f2e3b18e122b1c70c2f98f Parents: 0403f06 Author: Willem Jiang <willem.ji...@gmail.com> Authored: Wed Apr 22 16:18:31 2015 +0800 Committer: Willem Jiang <willem.ji...@gmail.com> Committed: Wed Apr 22 19:16:42 2015 +0800 ---------------------------------------------------------------------- .../java/org/apache/camel/component/netty4/NettyPayloadHelper.java | 2 ++ .../component/netty4/NettyUdpWithInOutUsingPlainSocketTest.java | 2 ++ 2 files changed, 4 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/d4fac456/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyPayloadHelper.java ---------------------------------------------------------------------- diff --git a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyPayloadHelper.java b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyPayloadHelper.java index 714957b..dd114e2 100644 --- a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyPayloadHelper.java +++ b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyPayloadHelper.java @@ -73,6 +73,8 @@ public final class NettyPayloadHelper { } // setup the sender address here for sending the response message back exchange.setProperty(NettyConstants.NETTY_REMOTE_ADDRESS, dp.sender()); + // setup the remote address to the message header at the same time + exchange.getIn().setHeader(NettyConstants.NETTY_REMOTE_ADDRESS, dp.sender()); } else { // normal transfer using the body only exchange.getIn().setBody(payload); http://git-wip-us.apache.org/repos/asf/camel/blob/d4fac456/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUdpWithInOutUsingPlainSocketTest.java ---------------------------------------------------------------------- diff --git a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUdpWithInOutUsingPlainSocketTest.java b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUdpWithInOutUsingPlainSocketTest.java index 7fafbd7..3d507af 100644 --- a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUdpWithInOutUsingPlainSocketTest.java +++ b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyUdpWithInOutUsingPlainSocketTest.java @@ -71,6 +71,8 @@ public class NettyUdpWithInOutUsingPlainSocketTest extends BaseNettyTest { String s = exchange.getIn().getBody(String.class); LOG.debug("Server got: " + s); exchange.getOut().setBody("Hello " + s); + // just make the remote address is there + assertNotNull("The remote address header should not be Null", exchange.getIn().getHeader(NettyConstants.NETTY_REMOTE_ADDRESS)); } }); }