cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject cxf git commit: [CXF-6778] Also cache and compare session to avoid stale Destination
Date Tue, 14 Mar 2017 11:11:14 GMT
Repository: cxf
Updated Branches:
  refs/heads/master f6ce97d4d -> a93f0d9ad


[CXF-6778] Also cache and compare session to avoid stale Destination


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a93f0d9a
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a93f0d9a
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a93f0d9a

Branch: refs/heads/master
Commit: a93f0d9ad891865cc635a961cb890c2031177e5b
Parents: f6ce97d
Author: Christian Schneider <chris@die-schneider.net>
Authored: Tue Mar 14 12:10:58 2017 +0100
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Tue Mar 14 12:10:58 2017 +0100

----------------------------------------------------------------------
 .../cxf/transport/jms/JMSConfiguration.java     | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/a93f0d9a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
index e8fba27..4b1052d 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
@@ -78,6 +78,12 @@ public class JMSConfiguration {
      */
     private String replyToDestination;
     private volatile Destination replyToDestinationDest;
+    
+    /**
+     * Session that was used to cache the replyToDestinationDest
+     */
+    private volatile Session replyDestinationSession;
+    
     private String messageType = JMSConstants.TEXT_MESSAGE_TYPE;
     private boolean pubSubDomain;
     private boolean replyPubSubDomain;
@@ -97,8 +103,6 @@ public class JMSConfiguration {
     private String targetService;
     private String requestURI;
 
-
-
     public void ensureProperlyConfigured() {
         ConnectionFactory cf = getConnectionFactory();
         if (cf == null) {
@@ -464,19 +468,17 @@ public class JMSConfiguration {
     }
 
     public Destination getReplyDestination(Session session) throws JMSException {
-        Destination result = replyDestinationDest;
-        if (result == null) {
+        if (this.replyDestinationDest == null || this.replyDestinationSession == null) {
             synchronized (this) {
-                result = replyDestinationDest;
-                if (result == null) {
-                    result = replyDestination == null
+                if (this.replyDestinationDest == null || this.replyDestinationSession ==
null) {
+                    this.replyDestinationDest = replyDestination == null
                         ? session.createTemporaryQueue()
                         : destinationResolver.resolveDestinationName(session, replyDestination,
replyPubSubDomain);
-                    replyDestinationDest = result;
+                    this.replyDestinationSession = session;
                 }
             }
         }
-        return result;
+        return this.replyDestinationDest;
     }
 
     public Destination getTargetDestination(Session session) throws JMSException {


Mime
View raw message