You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2017/03/15 18:43:44 UTC

[2/4] cxf git commit: [CXF-6778] Also cache and compare session to avoid stale Destination

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

# Conflicts:
#	rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java


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

Branch: refs/heads/3.1.x-fixes
Commit: 171feb8042756c2946435448fbf13605470958d3
Parents: 549a10c
Author: Christian Schneider <ch...@die-schneider.net>
Authored: Tue Mar 14 12:10:58 2017 +0100
Committer: Daniel Kulp <dk...@apache.org>
Committed: Wed Mar 15 14:04:52 2017 -0400

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


http://git-wip-us.apache.org/repos/asf/cxf/blob/171feb80/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 6269da6..9fe0427 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
@@ -76,6 +76,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;
@@ -95,8 +101,6 @@ public class JMSConfiguration {
     private String targetService;
     private String requestURI;
 
-
-
     public void ensureProperlyConfigured() {
         ConnectionFactory cf = getConnectionFactory();
         if (cf == null) {
@@ -441,19 +445,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 {