camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rom...@apache.org
Subject svn commit: r785534 - /camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
Date Wed, 17 Jun 2009 09:58:44 GMT
Author: romkal
Date: Wed Jun 17 09:58:43 2009
New Revision: 785534

URL: http://svn.apache.org/viewvc?rev=785534&view=rev
Log:
CAMEL-1723: Allowed customization of TTL when receiveTimeout set

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

Modified: camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java?rev=785534&r1=785533&r2=785534&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
(original)
+++ camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
Wed Jun 17 09:58:43 2009
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.jms;
 
+import static org.apache.camel.util.ObjectHelper.removeStartingCharacters;
+
 import javax.jms.ConnectionFactory;
 import javax.jms.Destination;
 import javax.jms.ExceptionListener;
@@ -49,8 +51,6 @@
 import org.springframework.jms.support.destination.DestinationResolver;
 import org.springframework.transaction.PlatformTransactionManager;
 import org.springframework.util.Assert;
-
-import static org.apache.camel.util.ObjectHelper.removeStartingCharacters;
 /**
  * @version $Revision$
  */
@@ -334,7 +334,10 @@
         if (answer instanceof JmsTemplate && requestTimeout > 0) {
             JmsTemplate jmsTemplate = (JmsTemplate) answer;
             jmsTemplate.setExplicitQosEnabled(true);
-            jmsTemplate.setTimeToLive(requestTimeout);
+            if (timeToLive < 0) {
+                // If TTL not specified, then default to
+                jmsTemplate.setTimeToLive(requestTimeout);
+            }
             jmsTemplate.setSessionTransacted(isTransactedInOut());
             if (isTransactedInOut()) {
                 jmsTemplate.setSessionAcknowledgeMode(Session.SESSION_TRANSACTED);



Mime
View raw message