You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2011/11/09 16:45:44 UTC
svn commit: r1199807 - in /camel/branches/camel-2.8.x: ./
components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/MessageSelectorCreator.java
Author: davsclaus
Date: Wed Nov 9 15:45:43 2011
New Revision: 1199807
URL: http://svn.apache.org/viewvc?rev=1199807&view=rev
Log:
CAMEL-2740: Fixed memory leak when doing request/reply over JMS with a fixed replyTo queue. Due correlationIDs in JMSMessage Selector not in sync with current active correlation ids.
Modified:
camel/branches/camel-2.8.x/ (props changed)
camel/branches/camel-2.8.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/MessageSelectorCreator.java
Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Nov 9 15:45:43 2011
@@ -1 +1 @@
-/camel/trunk:1186106,1186625,1186772,1187221,1187485,1187882,1187893,1188070-1188085,1188642,1188674,1188879,1188881,1189139,1189600,1189681,1189693,1189737,1190212-1190213,1190246,1190303,1195317,1195616,1196210,1197450,1197933,1197948,1198199,1198338,1198340,1199123,1199137,1199654,1199683,1199703,1199739
+/camel/trunk:1186106,1186625,1186772,1187221,1187485,1187882,1187893,1188070-1188085,1188642,1188674,1188879,1188881,1189139,1189600,1189681,1189693,1189737,1190212-1190213,1190246,1190303,1195317,1195616,1196210,1197450,1197933,1197948,1198199,1198338,1198340,1199123,1199137,1199654,1199683,1199703,1199739,1199804
Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: camel/branches/camel-2.8.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/MessageSelectorCreator.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/MessageSelectorCreator.java?rev=1199807&r1=1199806&r2=1199807&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/MessageSelectorCreator.java (original)
+++ camel/branches/camel-2.8.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/MessageSelectorCreator.java Wed Nov 9 15:45:43 2011
@@ -16,8 +16,7 @@
*/
package org.apache.camel.component.jms.reply;
-import java.util.LinkedHashSet;
-import java.util.Set;
+import java.util.concurrent.ConcurrentSkipListSet;
/**
* A creator which can build the JMS message selector query string to use
@@ -25,7 +24,7 @@ import java.util.Set;
*/
public class MessageSelectorCreator implements CorrelationListener {
protected final CorrelationMap timeoutMap;
- protected final Set<String> correlationIds;
+ protected final ConcurrentSkipListSet<String> correlationIds;
protected boolean dirty = true;
protected StringBuilder expression;
@@ -34,7 +33,8 @@ public class MessageSelectorCreator impl
this.timeoutMap.setListener(this);
// create local set of correlation ids, as its easier to keep track
// using the listener so we can flag the dirty flag upon changes
- this.correlationIds = new LinkedHashSet<String>();
+ // must support concurrent access
+ this.correlationIds = new ConcurrentSkipListSet<String>();
}
public synchronized String get() {
@@ -60,8 +60,10 @@ public class MessageSelectorCreator impl
}
}
+ String answer = expression.toString();
+
dirty = false;
- return expression.toString();
+ return answer;
}
public void onPut(String key) {