cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r820160 - in /cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms: JMSConfiguration.java continuations/JMSContinuation.java
Date Wed, 30 Sep 2009 03:08:59 GMT
Author: dkulp
Date: Wed Sep 30 03:08:58 2009
New Revision: 820160

URL: http://svn.apache.org/viewvc?rev=820160&view=rev
Log:
[CXF-2391] Re-implement as a percent of the max to simplify

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/continuations/JMSContinuation.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=820160&r1=820159&r2=820160&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
Wed Sep 30 03:08:58 2009
@@ -70,7 +70,7 @@
     private int maxConcurrentConsumers = 1;
     private int maxConcurrentTasks = 10;
     private int maxSuspendedContinuations = DEFAULT_VALUE;
-    private int reconnectSuspendedContinuations = DEFAULT_VALUE;
+    private int reconnectPercentOfMax = 70;
 
     private volatile String messageSelector;
     private boolean subscriptionDurable;
@@ -348,12 +348,12 @@
         this.maxSuspendedContinuations = maxSuspendedContinuations;
     }
     
-    public int getReconnectSuspendedContinuations() {
-        return reconnectSuspendedContinuations;
+    public int getReconnectPercentOfMax() {
+        return reconnectPercentOfMax;
     }
 
-    public void setReconnectSuspendedContinuations(int reconnectSuspendedContinuations) {
-        this.reconnectSuspendedContinuations = reconnectSuspendedContinuations;
+    public void setReconnectPercentOfMax(int reconnectPercentOfMax) {
+        this.reconnectPercentOfMax = reconnectPercentOfMax;
     }
 
     public TaskExecutor getTaskExecutor() {

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java?rev=820160&r1=820159&r2=820160&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java
(original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java
Wed Sep 30 03:08:58 2009
@@ -164,10 +164,16 @@
             modifyList(remove);
             if (continuations.size() >= jmsConfig.getMaxSuspendedContinuations()) {
                 jmsListener.stop();
-            } else if (!jmsListener.isRunning()
-                && (jmsConfig.getReconnectSuspendedContinuations() < 0
-                    || continuations.size() <= jmsConfig.getReconnectSuspendedContinuations()))
{
-                jmsListener.start();
+            } else if (!jmsListener.isRunning()) {
+                int limit = jmsConfig.getReconnectPercentOfMax();
+                if (limit < 0 || limit > 100) {
+                    limit = 70;
+                }
+                limit = (limit * jmsConfig.getReconnectPercentOfMax()) / 100; 
+            
+                if (continuations.size() <= limit) {
+                    jmsListener.start();
+                }
             }
         }
 



Mime
View raw message