Preserve headers in QuickfixjProducer.process()

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f1056cf8
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f1056cf8
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f1056cf8

Branch: refs/heads/camel-2.12.x
Commit: f1056cf843c8cd5ae0e525495ac7dc9115a6eed0
Parents: 55aecb4
Author: Grzegorz Grzybek <ggrzy...@redhat.com>
Authored: Tue Feb 11 11:15:03 2014 +0100
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Tue Feb 11 12:16:56 2014 +0100

----------------------------------------------------------------------
 .../org/apache/camel/component/quickfixj/QuickfixjProducer.java     | 1 +
 .../org/apache/camel/component/quickfixj/QuickfixjProducerTest.java | 1 +
 2 files changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f1056cf8/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjProducer.java
----------------------------------------------------------------------
diff --git 
a/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjProducer.java
 
b/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjProducer.java
index ff262c0..9e1dbf0 100644
--- 
a/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjProducer.java
+++ 
b/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjProducer.java
@@ -77,6 +77,7 @@ public class QuickfixjProducer extends DefaultProducer {
 
         if (callable != null) {
             Message reply = callable.call();
+            exchange.getOut().getHeaders().putAll(camelMessage.getHeaders());
             exchange.getOut().setBody(reply);
         }
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/f1056cf8/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjProducerTest.java
----------------------------------------------------------------------
diff --git 
a/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjProducerTest.java
 
b/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjProducerTest.java
index 498f6ff..be6f341 100644
--- 
a/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjProducerTest.java
+++ 
b/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjProducerTest.java
@@ -153,6 +153,7 @@ public class QuickfixjProducerTest {
         
         Mockito.verify(mockExchange, 
Mockito.never()).setException(Matchers.isA(IllegalStateException.class));
         Mockito.verify(mockSession).send(inboundFixMessage);
+        Mockito.verify(mockOutboundCamelMessage).getHeaders();
         Mockito.verify(mockOutboundCamelMessage).setBody(outboundFixMessage);
     }
     

Reply via email to