cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r737356 - in /cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms: JMSConfiguration.java JMSFactory.java JMSOldConfigHolder.java
Date Sat, 24 Jan 2009 13:15:16 GMT
Author: cschneider
Date: Sat Jan 24 13:15:15 2009
New Revision: 737356

URL: http://svn.apache.org/viewvc?rev=737356&view=rev
Log:
Fix for CXF-2002. Added configuration for maximum concurrent execution threads

Modified:
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java?rev=737356&r1=737355&r2=737356&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
(original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
Sat Jan 24 13:15:15 2009
@@ -50,6 +50,7 @@
     
     private int concurrentConsumers = 1;
     private int maxConcurrentConsumers = 1;
+    private int maxConcurrentTasks = 10;
 
     private volatile String messageSelector;
     private boolean subscriptionDurable;
@@ -275,4 +276,12 @@
         return useConduitIdSelector;
     }
 
+    public int getMaxConcurrentTasks() {
+        return maxConcurrentTasks;
+    }
+
+    public void setMaxConcurrentTasks(int maxConcurrentTasks) {
+        this.maxConcurrentTasks = maxConcurrentTasks;
+    }
+
 }

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java?rev=737356&r1=737355&r2=737356&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
(original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
Sat Jan 24 13:15:15 2009
@@ -24,6 +24,7 @@
 import javax.jms.QueueSession;
 import javax.jms.Session;
 
+import org.springframework.core.task.SimpleAsyncTaskExecutor;
 import org.springframework.jms.core.JmsTemplate;
 import org.springframework.jms.core.JmsTemplate102;
 import org.springframework.jms.core.SessionCallback;
@@ -101,6 +102,10 @@
         }
         if (jmsConfig.getTaskExecutor() != null) {
             jmsListener.setTaskExecutor(jmsConfig.getTaskExecutor());
+        } else {
+            SimpleAsyncTaskExecutor taskExecutor = new SimpleAsyncTaskExecutor();
+            taskExecutor.setConcurrencyLimit(jmsConfig.getMaxConcurrentTasks());
+            jmsListener.setTaskExecutor(taskExecutor);
         }
         JmsTemplate jmsTemplate = createJmsTemplate(jmsConfig, null);
         Destination dest = JMSFactory.resolveOrCreateDestination(jmsTemplate, destinationName,
jmsConfig

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java?rev=737356&r1=737355&r2=737356&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java
(original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java
Sat Jan 24 13:15:15 2009
@@ -119,14 +119,12 @@
             if (address.isSetDestinationStyle()) {
                 pubSubDomain = DestinationStyleType.TOPIC == address.getDestinationStyle();
             }
-            
             if (jmsConfig.getConnectionFactory() == null) {
                 ConnectionFactory cf = getConnectionFactoryFromJndi(jt, pubSubDomain);
                 jmsConfig.setConnectionFactory(cf);
             }
-        
             jmsConfig.setDurableSubscriptionName(serverBehavior.getDurableSubscriberName());
-            jmsConfig.setExplicitQosEnabled(true);        
+            jmsConfig.setExplicitQosEnabled(true);
             jmsConfig.setMessageSelector(serverBehavior.getMessageSelector());        
             if (isConduit && runtimePolicy.isSetMessageType()) {
                 jmsConfig.setMessageType(runtimePolicy.getMessageType().value());
@@ -138,21 +136,21 @@
             //}
             jmsConfig.setUseConduitIdSelector(clientConfig.isUseConduitIdSelector());
             jmsConfig.setSubscriptionDurable(serverBehavior.isSetDurableSubscriberName());
      
-            jmsConfig.setDurableSubscriptionName(serverBehavior.getDurableSubscriberName());
       
-        
+            jmsConfig.setDurableSubscriptionName(serverBehavior.getDurableSubscriberName());
+            if (sessionPool.isSetHighWaterMark()) {
+                jmsConfig.setMaxConcurrentTasks(sessionPool.getHighWaterMark());
+            }
             long timeToLive = isConduit ? clientConfig.getMessageTimeToLive() : serverConfig
                 .getMessageTimeToLive();
             jmsConfig.setTimeToLive(timeToLive);            
             if (address.isSetUseJms11()) {                
                 jmsConfig.setUseJms11(address.isUseJms11());        
             }
-            boolean useJndi = address.isSetJndiDestinationName();
-            jmsConfig.setUseJndi(useJndi);
-        
             if (serverBehavior.isSetTransactional()) {
                 jmsConfig.setSessionTransacted(serverBehavior.isTransactional());       
        
-            }            
-
+            }
+            boolean useJndi = address.isSetJndiDestinationName();
+            jmsConfig.setUseJndi(useJndi);
             if (useJndi) {
                 // Setup Destination jndi destination resolver
                 final JndiDestinationResolver jndiDestinationResolver = new JndiDestinationResolver();



Mime
View raw message