[
https://issues.apache.org/jira/browse/CAMEL-12069?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16281021#comment-16281021
]
ASF GitHub Bot commented on CAMEL-12069:
----------------------------------------
asfgit closed pull request #2139: CAMEL-12069: ActiveMQ/JMS component:
transferExchange option does not…
URL: https://github.com/apache/camel/pull/2139
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
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 9ebe7047f77..0de72fe4395 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 @@ protected Message createJmsMessage(Exchange exchange,
Object body, Map<String, O
// 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 f7efd684f63..cc4721a0307 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 void process(Exchange exchange) throws Exception {
map.put("double", new Double(1.23));
exchange.getIn().setHeaders(map);
+
+ exchange.setProperty("PropertyName", "PropertyValue");
}
});
@@ -88,6 +90,7 @@ public void process(Exchange exchange) throws Exception {
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 void process(Exchange exchange) throws Exception {
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 71d25e88341..1aa15721b35 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 void testSendExchange() throws Exception {
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 {
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> ActiveMQ/JMS component: transferExchange option does not transfer exchange
> properties anymore
> ---------------------------------------------------------------------------------------------
>
> Key: CAMEL-12069
> URL: https://issues.apache.org/jira/browse/CAMEL-12069
> Project: Camel
> Issue Type: Bug
> Components: camel-activemq, camel-jms
> Affects Versions: 2.19.0, 2.20.1
> Reporter: Pascal Schumacher
>
> The ActiveMQ/JMS component documenation generated from the
> _JMSComponent#setTransferExchange_ javadoc states:
> {quote}
> You can transfer the exchange over the wire instead of just the body and
> headers.
> The following fields are transferred: In body, Out body, Fault body, In
> headers, Out headers, Fault headers, exchange properties, exchange exception.
> {quote}
> But exchange properties are *not* transfered.
> I debuged into this and noticed that _JMSBinding#createJmsMessage_ calls
> _DefaultExchangeHolder.marshal(exchange, false,
> endpoint.isAllowSerializedHeaders())_ when _transferExchange_ is _true_. The
> _false_ parameter is the reason that the exchange properties are not included
> in the JMS message.
> This should either be fixed or the documentation should be updated.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)