camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r774678 - /camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java
Date Thu, 14 May 2009 08:20:59 GMT
Author: davsclaus
Date: Thu May 14 08:20:58 2009
New Revision: 774678

URL: http://svn.apache.org/viewvc?rev=774678&view=rev
Log:
CAMEL-1614:Fixed bug if JMSReplyTo was in headers but null. To avoid WARN logs for InOnly
messages with no JMSReplyTo anyway.

Modified:
    camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java

Modified: camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java?rev=774678&r1=774677&r2=774678&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java
(original)
+++ camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java
Thu May 14 08:20:58 2009
@@ -273,15 +273,17 @@
             }
         } else {
             // we must honor these special flags to preverse QoS 
-            if (!endpoint.isPreserveMessageQos() && !endpoint.isExplicitQosEnabled()
-                    && exchange.getIn().getHeaders().containsKey("JMSReplyTo")) {
-                // we are routing an existing JmsMessage, origin from another JMS endpoint
-                // then we need to remove the existing JMSReplyTo, JMSCorrelationID.
-                // as we are not out capable and thus do not expect a reply, and therefore
-                // the consumer of this message we send should not return a reply
-                String to = destinationName != null ? destinationName : "" + destination;
-                LOG.warn("Disabling JMSReplyTo as this Exchange is not OUT capable: " + exchange
+ " with destination: " + to);
-                exchange.getIn().setHeader("JMSReplyTo", null);
+            if (!endpoint.isPreserveMessageQos() && !endpoint.isExplicitQosEnabled())
{
+                Object replyTo = exchange.getIn().getHeader("JMSReplyTo");
+                if (replyTo != null) {
+                    // we are routing an existing JmsMessage, origin from another JMS endpoint
+                    // then we need to remove the existing JMSReplyTo
+                    // as we are not out capable and thus do not expect a reply, and therefore
+                    // the consumer of this message we send should not return a reply
+                    String to = destinationName != null ? destinationName : "" + destination;
+                    LOG.warn("Disabling JMSReplyTo as this Exchange is not OUT capable with
JMSReplyTo: " + replyTo + " to destination: " + to + " for Exchange: " + exchange);
+                    exchange.getIn().setHeader("JMSReplyTo", null);
+                }
             }
 
             MessageCreator messageCreator = new MessageCreator() {



Mime
View raw message