[camel] branch master updated: CAMEL-12069: ActiveMQ/JMS component: transferExchange option does not transfer exchange properties anymore (closes #2139)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[camel] branch master updated: CAMEL-12069: ActiveMQ/JMS component: transferExchange option does not transfer exchange properties anymore (closes #2139)

pascalschumacher
This is an automated email from the ASF dual-hosted git repository.

pascalschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 76c2d90  CAMEL-12069: ActiveMQ/JMS component: transferExchange option does not transfer exchange properties anymore (closes #2139)
76c2d90 is described below

commit 76c2d9003f73dda3c3a5f5f20ba198900ed05706
Author: Pascal Schumacher <[hidden email]>
AuthorDate: Wed Dec 6 20:58:02 2017 +0100

    CAMEL-12069: ActiveMQ/JMS component: transferExchange option does not transfer exchange properties anymore (closes #2139)
   
    TransferExchange now includes exchange properties again. This restores the previous behavior accidentally broken by 5dd59162e4ac9335e497934b8d662f598cb779d1.
---
 .../src/main/java/org/apache/camel/component/jms/JmsBinding.java      | 2 +-
 .../org/apache/camel/component/jms/JmsInOutTransferExchangeTest.java  | 4 ++++
 .../java/org/apache/camel/component/jms/JmsTransferExchangeTest.java  | 1 +
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
index 9ebe704..0de72fe 100644
--- a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
+++ b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
@@ -518,7 +518,7 @@ public class JmsBinding {
         // special for transferExchange
         if (endpoint != null && endpoint.isTransferExchange()) {
             LOG.trace("Option transferExchange=true so we use JmsMessageType: Object");
-            Serializable holder = DefaultExchangeHolder.marshal(exchange, false, endpoint.isAllowSerializedHeaders());
+            Serializable holder = DefaultExchangeHolder.marshal(exchange, true, endpoint.isAllowSerializedHeaders());
             Message answer = session.createObjectMessage(holder);
             // ensure default delivery mode is used by default
             answer.setJMSDeliveryMode(Message.DEFAULT_DELIVERY_MODE);
diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsInOutTransferExchangeTest.java b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsInOutTransferExchangeTest.java
index f7efd68..cc4721a 100644
--- a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsInOutTransferExchangeTest.java
+++ b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsInOutTransferExchangeTest.java
@@ -67,6 +67,8 @@ public class JmsInOutTransferExchangeTest extends CamelTestSupport {
                 map.put("double", new Double(1.23));
 
                 exchange.getIn().setHeaders(map);
+
+                exchange.setProperty("PropertyName", "PropertyValue");
             }
         });
 
@@ -88,6 +90,7 @@ public class JmsInOutTransferExchangeTest extends CamelTestSupport {
         assertEquals((Long) 123L, exchange.getIn().getHeader("long", Long.class));
         assertEquals((Double) 1.23, exchange.getIn().getHeader("double", Double.class));
         assertEquals("hello", exchange.getIn().getHeader("string", String.class));
+        assertEquals("PropertyValue", exchange.getProperty("PropertyName"));
         
         Exchange resultExchange = result.getExchanges().get(0);
         assertTrue(resultExchange.getIn() instanceof JmsMessage);
@@ -103,6 +106,7 @@ public class JmsInOutTransferExchangeTest extends CamelTestSupport {
         assertEquals((Long) 123L, exchange.getIn().getHeader("long", Long.class));
         assertEquals((Double) 1.23, exchange.getIn().getHeader("double", Double.class));
         assertEquals("hello", exchange.getIn().getHeader("string", String.class));
+        assertEquals("PropertyValue", exchange.getProperty("PropertyName"));
     }
 
     @Override
diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsTransferExchangeTest.java b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsTransferExchangeTest.java
index 71d25e8..1aa1572 100644
--- a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsTransferExchangeTest.java
+++ b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsTransferExchangeTest.java
@@ -62,6 +62,7 @@ public class JmsTransferExchangeTest extends CamelTestSupport {
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedBodiesReceived("Hello World");
         mock.expectedHeaderReceived("foo", "cheese");
+        mock.expectedPropertyReceived("bar", 123);
 
         template.send("direct:start", new Processor() {
             public void process(Exchange exchange) throws Exception {

--
To stop receiving notification emails like this one, please contact
['"[hidden email]" <[hidden email]>'].