camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1309820 - in /camel/branches/camel-2.9.x: ./ components/camel-jms/src/main/java/org/apache/camel/component/jms/ components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/ components/camel-jms/src/test/java/org/apache/camel/co...
Date Thu, 05 Apr 2012 12:30:21 GMT
Author: davsclaus
Date: Thu Apr  5 12:30:20 2012
New Revision: 1309820

URL: http://svn.apache.org/viewvc?rev=1309820&view=rev
Log:
CAMEL-5141: camel-jms - Allow to configure frequency of timeout checker when doing request/reply
over JMS

Added:
    camel/branches/camel-2.9.x/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTimeoutCheckerIntervalTest.java
      - copied unchanged from r1309819, camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTimeoutCheckerIntervalTest.java
Modified:
    camel/branches/camel-2.9.x/   (props changed)
    camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java
    camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
    camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java
    camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/ReplyManagerSupport.java

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1309819

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

Modified: camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java?rev=1309820&r1=1309819&r2=1309820&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java
Thu Apr  5 12:30:20 2012
@@ -326,6 +326,10 @@ public class JmsComponent extends Defaul
         getConfiguration().setRequestTimeout(requestTimeout);
     }
 
+    public void setRequestTimeoutCheckerInterval(long requestTimeoutCheckerInterval) {
+        getConfiguration().setRequestTimeoutCheckerInterval(requestTimeoutCheckerInterval);
+    }
+
     public void setTransferExchange(boolean transferExchange) {
         getConfiguration().setTransferExchange(transferExchange);
     }

Modified: camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java?rev=1309820&r1=1309819&r2=1309820&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
Thu Apr  5 12:30:20 2012
@@ -87,6 +87,7 @@ public class JmsConfiguration implements
     private long recoveryInterval = -1;
     private long receiveTimeout = -1;
     private long requestTimeout = 20000L;
+    private long requestTimeoutCheckerInterval = 1000L;
     private int idleTaskExecutionLimit = 1;
     private int idleConsumerLimit = 1;
     private int maxConcurrentConsumers;
@@ -1059,7 +1060,7 @@ public class JmsConfiguration implements
 
     /**
      * Factory method which which allows derived classes to customize the lazy
-     * transcationManager creation
+     * transaction manager creation
      */
     protected PlatformTransactionManager createTransactionManager() {
         JmsTransactionManager answer = new JmsTransactionManager();
@@ -1110,6 +1111,17 @@ public class JmsConfiguration implements
         this.requestTimeout = requestTimeout;
     }
 
+    public long getRequestTimeoutCheckerInterval() {
+        return requestTimeoutCheckerInterval;
+    }
+
+    /**
+     * Sets the interval in milliseconds how often the request timeout checker should run.
+     */
+    public void setRequestTimeoutCheckerInterval(long requestTimeoutCheckerInterval) {
+        this.requestTimeoutCheckerInterval = requestTimeoutCheckerInterval;
+    }
+
     public String getReplyTo() {
         return replyToDestination;
     }

Modified: camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java?rev=1309820&r1=1309819&r2=1309820&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java
Thu Apr  5 12:30:20 2012
@@ -631,6 +631,11 @@ public class JmsEndpoint extends Default
         return getConfiguration().getRequestTimeout();
     }
 
+    @ManagedAttribute
+    public long getRequestTimeoutCheckerInterval() {
+        return getConfiguration().getRequestTimeoutCheckerInterval();
+    }
+
     public TaskExecutor getTaskExecutor() {
         return getConfiguration().getTaskExecutor();
     }

Modified: camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/ReplyManagerSupport.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/ReplyManagerSupport.java?rev=1309820&r1=1309819&r2=1309820&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/ReplyManagerSupport.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/ReplyManagerSupport.java
Thu Apr  5 12:30:20 2012
@@ -205,8 +205,10 @@ public abstract class ReplyManagerSuppor
         ObjectHelper.notNull(executorService, "executorService", this);
         ObjectHelper.notNull(endpoint, "endpoint", this);
 
-        // purge for timeout every second
-        correlation = new CorrelationTimeoutMap(executorService, 1000);
+        // timeout map to use for purging messages which have timed out, while waiting for
an expected reply
+        // when doing request/reply over JMS
+        log.trace("Using timeout checker interval with {} millis", endpoint.getRequestTimeoutCheckerInterval());
+        correlation = new CorrelationTimeoutMap(executorService, endpoint.getRequestTimeoutCheckerInterval());
         ServiceHelper.startService(correlation);
 
         // create JMS listener and start it



Mime
View raw message