Author: jstrachan
Date: Thu Oct  2 09:33:43 2008
New Revision: 701179

URL: http://svn.apache.org/viewvc?rev=701179&view=rev
Log:
added a fix for CAMEL-959 so that InOut uses non transacted by default unless 
explicitly enabled via the transactedInOut property

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

Modified: 
activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java?rev=701179&r1=701178&r2=701179&view=diff
==============================================================================
--- 
activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
 (original)
+++ 
activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
 Thu Oct  2 09:33:43 2008
@@ -114,6 +114,7 @@
     private int priority = -1;
     // Transaction related configuration
     private boolean transacted;
+    private boolean transactedInOut;
     private PlatformTransactionManager transactionManager;
     private String transactionName;
     private int transactionTimeout = -1;
@@ -301,6 +302,7 @@
             JmsTemplate jmsTemplate = (JmsTemplate)answer;
             jmsTemplate.setExplicitQosEnabled(true);
             jmsTemplate.setTimeToLive(requestTimeout);
+            jmsTemplate.setSessionTransacted(isTransactedInOut());
         }
         return answer;
     }
@@ -707,6 +709,21 @@
         this.transacted = consumerTransacted;
     }
 
+    /**
+     * Should InOut operations (request reply) default to using transacted 
mode?
+     *
+     * By default this is false as you need to commit the outgoing request 
before you can consume the input
+     *
+     * @return
+     */
+    public boolean isTransactedInOut() {
+        return transactedInOut;
+    }
+
+    public void setTransactedInOut(boolean transactedInOut) {
+        this.transactedInOut = transactedInOut;
+    }
+
     public boolean isEagerLoadingOfProperties() {
         return eagerLoadingOfProperties;
     }


Reply via email to