You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2009/03/26 14:40:53 UTC

svn commit: r758638 - in /camel/branches/camel-1.x: ./ components/camel-jms/src/main/java/org/apache/camel/component/jms/ components/camel-xmpp/src/test/resources/

Author: davsclaus
Date: Thu Mar 26 13:40:45 2009
New Revision: 758638

URL: http://svn.apache.org/viewvc?rev=758638&view=rev
Log:
Merged revisions 758617 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk

........
  r758617 | davsclaus | 2009-03-26 13:58:49 +0100 (Thu, 26 Mar 2009) | 1 line
  
  CAMEL-1461: JMSProducer does not forward JMSReplyTo for not OUT capable, unless QoS is preserved.
........

Modified:
    camel/branches/camel-1.x/   (props changed)
    camel/branches/camel-1.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
    camel/branches/camel-1.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java
    camel/branches/camel-1.x/components/camel-xmpp/src/test/resources/   (props changed)

Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 26 13:40:45 2009
@@ -1 +1 @@
-/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749936,749956,750017,750334,750396,750761,750796,752068,752117,752418,752751-752755,752764-752773,752956,753087,753101,753175,755136,755487,756313,756348,756870,757636,757693,757743,757865,758539,758563,758600
+/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749936,749956,750017,750334,750396,750761,750796,752068,752117,752418,752751-752755,752764-752773,752956,753087,753101,753175,755136,755487,756313,756348,756870,757636,757693,757743,757865,758539,758563,758600,758617

Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-1.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java?rev=758638&r1=758637&r2=758638&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java (original)
+++ camel/branches/camel-1.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java Thu Mar 26 13:40:45 2009
@@ -227,13 +227,7 @@
                 jmsMessage.setJMSCorrelationID(ExchangeHelper.convertToType(exchange, String.class,
                     headerValue));
             } else if (headerName.equals("JMSReplyTo") && headerValue != null) {
-                if (exchange.getPattern().isOutCapable()) {
-                    // only set the JMSReply if the Exchange supports Out
-                    jmsMessage.setJMSReplyTo(ExchangeHelper.convertToType(exchange, Destination.class, headerValue));
-                } else {
-                    // warn we got a JMSReplyTo but the Exchange is not out capable
-                    LOG.warn("Exchange is not out capable, Ignoring JMSReplyTo: " + headerValue);
-                }
+                jmsMessage.setJMSReplyTo(ExchangeHelper.convertToType(exchange, Destination.class, headerValue));
             } else if (headerName.equals("JMSType")) {
                 jmsMessage.setJMSType(ExchangeHelper.convertToType(exchange, String.class, headerValue));
             } else if (LOG.isDebugEnabled()) {

Modified: camel/branches/camel-1.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java?rev=758638&r1=758637&r2=758638&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java (original)
+++ camel/branches/camel-1.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java Thu Mar 26 13:40:45 2009
@@ -224,6 +224,18 @@
                 exchange.setException(e);
             }
         } else {
+            if (!endpoint.getConfiguration().isPreserveMessageQos() && !endpoint.getConfiguration().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 = endpoint.getDestination();
+                LOG.warn("Disabling JMSReplyTo as this Exchange is not OUT capable: " + exchange + " with destination: " + to);
+                exchange.getIn().setHeader("JMSReplyTo", null);
+                exchange.getIn().setHeader("JMSCorrelationID", null);
+            }
+
             getInOnlyTemplate().send(endpoint.getDestination(), new MessageCreator() {
                 public Message createMessage(Session session) throws JMSException {
                     Message message = endpoint.getBinding().makeJmsMessage(exchange, in, session);

Propchange: camel/branches/camel-1.x/components/camel-xmpp/src/test/resources/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 26 13:40:45 2009
@@ -1 +1 @@
-/camel/trunk/components/camel-xmpp/src/test/resources:757693,757743,757865,758539,758563
+/camel/trunk/components/camel-xmpp/src/test/resources:757693,757743,757865,758539,758563,758617