You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kw...@apache.org on 2018/05/03 09:49:01 UTC
[1/3] qpid-jms-amqp-0-x git commit: QPID-8141: [JMS AMQP 0-x] Enforce
resolution of destinations with unset legacy fields
Repository: qpid-jms-amqp-0-x
Updated Branches:
refs/heads/6.3.x 37b6ce317 -> 7d8bc4d1f
QPID-8141: [JMS AMQP 0-x] Enforce resolution of destinations with unset legacy fields
Cherry picked from master 4ef8f7a4e313cc92885ad5d2e0c3833df16b7d1e
Project: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/commit/610148e9
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/tree/610148e9
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/diff/610148e9
Branch: refs/heads/6.3.x
Commit: 610148e96e17afae76c51259672783f1e68ab41e
Parents: 37b6ce3
Author: Alex Rudyy <or...@apache.org>
Authored: Mon Apr 30 13:54:59 2018 +0100
Committer: Keith Wall <kw...@apache.org>
Committed: Thu May 3 10:47:29 2018 +0100
----------------------------------------------------------------------
.../java/org/apache/qpid/client/AMQSession.java | 25 +++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/blob/610148e9/client/src/main/java/org/apache/qpid/client/AMQSession.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/qpid/client/AMQSession.java b/client/src/main/java/org/apache/qpid/client/AMQSession.java
index 63cc7a8..cba764e 100644
--- a/client/src/main/java/org/apache/qpid/client/AMQSession.java
+++ b/client/src/main/java/org/apache/qpid/client/AMQSession.java
@@ -676,7 +676,30 @@ public abstract class AMQSession<C extends BasicMessageConsumer, P extends Basic
boolean isResolved(final AMQDestination dest)
{
- return _resolvedDestinations.contains(dest);
+ if (!_resolvedDestinations.contains(dest))
+ {
+ return false;
+ }
+
+ if (dest.getAddressType() == AMQDestination.QUEUE_TYPE)
+ {
+ // verify legacy fields are set
+ return dest.getQueueName() != null
+ && dest.getQueueName().equals(dest.getAddressName())
+ && dest.getExchangeName() != null
+ && dest.getExchangeClass() != null
+ && dest.getRoutingKey() != null;
+ }
+ else if (dest.getAddressType() == AMQDestination.TOPIC_TYPE)
+ {
+ // verify legacy fields are set
+ return dest.getExchangeName() != null
+ && dest.getExchangeName().equals(dest.getAddressName())
+ && dest.getExchangeClass() != null
+ && (dest.getSubject() == null
+ || (dest.getSubject() != null && dest.getSubject().equals(dest.getRoutingKey())));
+ }
+ return false;
}
public abstract int resolveAddressType(AMQDestination dest) throws QpidException;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[3/3] qpid-jms-amqp-0-x git commit: QPID-8141: [JMS AMQP 0-x] Bug fix
- restore cache like behaviour
Posted by kw...@apache.org.
QPID-8141: [JMS AMQP 0-x] Bug fix - restore cache like behaviour
Project: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/commit/7d8bc4d1
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/tree/7d8bc4d1
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/diff/7d8bc4d1
Branch: refs/heads/6.3.x
Commit: 7d8bc4d1f245f51cf4b27c73b19d151dca1e3f1b
Parents: a387cf8
Author: Keith Wall <kw...@apache.org>
Authored: Thu May 3 09:49:53 2018 +0100
Committer: Keith Wall <kw...@apache.org>
Committed: Thu May 3 10:48:48 2018 +0100
----------------------------------------------------------------------
.../src/main/java/org/apache/qpid/client/AMQSession.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/blob/7d8bc4d1/client/src/main/java/org/apache/qpid/client/AMQSession.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/qpid/client/AMQSession.java b/client/src/main/java/org/apache/qpid/client/AMQSession.java
index b5d4870..5d97a8b 100644
--- a/client/src/main/java/org/apache/qpid/client/AMQSession.java
+++ b/client/src/main/java/org/apache/qpid/client/AMQSession.java
@@ -21,6 +21,7 @@
package org.apache.qpid.client;
import java.io.Serializable;
+import java.lang.ref.WeakReference;
import java.net.URISyntaxException;
import java.text.MessageFormat;
import java.util.ArrayList;
@@ -150,8 +151,8 @@ public abstract class AMQSession<C extends BasicMessageConsumer, P extends Basic
*/
protected final boolean DAEMON_DISPATCHER_THREAD = Boolean.getBoolean(ClientProperties.DAEMON_DISPATCHER);
- private final Map<AMQDestination, AMQDestination>
- _resolvedDestinations = Collections.synchronizedMap(new WeakHashMap<AMQDestination, AMQDestination>());
+ private final Map<AMQDestination, WeakReference<AMQDestination>>
+ _resolvedDestinations = Collections.synchronizedMap(new WeakHashMap<AMQDestination, WeakReference<AMQDestination>> ());
private final long _dispatcherShutdownTimeoutMs;
@@ -661,7 +662,7 @@ public abstract class AMQSession<C extends BasicMessageConsumer, P extends Basic
void setResolved(final AMQDestination dest)
{
- _resolvedDestinations.put(dest, dest);
+ _resolvedDestinations.put(dest, new WeakReference<>(dest));
}
void setUnresolved(final AMQDestination dest)
@@ -676,7 +677,8 @@ public abstract class AMQSession<C extends BasicMessageConsumer, P extends Basic
boolean isResolved(final AMQDestination dest)
{
- AMQDestination resolvedDest = _resolvedDestinations.get(dest);
+ final WeakReference<AMQDestination> resolvedDestRef = _resolvedDestinations.get(dest);
+ final AMQDestination resolvedDest = resolvedDestRef == null ? null : resolvedDestRef.get();
if (resolvedDest == dest)
{
return true;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[2/3] qpid-jms-amqp-0-x git commit: QPID-8141: [JMS AMQP 0-x] Avoid
repeated exchange.declare when publishing when BURL address is in-use.
Posted by kw...@apache.org.
QPID-8141: [JMS AMQP 0-x] Avoid repeated exchange.declare when publishing when BURL address is in-use.
Cherry picked from master 6a5ffcf484c5bfab4b0e8ca3453baf9a7ba0c1c0
Project: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/commit/a387cf8b
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/tree/a387cf8b
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/diff/a387cf8b
Branch: refs/heads/6.3.x
Commit: a387cf8becbbbb6e3fcda152f35c22b7b5a0f483
Parents: 610148e
Author: Keith Wall <kw...@apache.org>
Authored: Wed May 2 22:32:30 2018 +0100
Committer: Keith Wall <kw...@apache.org>
Committed: Thu May 3 10:48:29 2018 +0100
----------------------------------------------------------------------
.../java/org/apache/qpid/client/AMQSession.java | 40 ++++++++------------
1 file changed, 16 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/blob/a387cf8b/client/src/main/java/org/apache/qpid/client/AMQSession.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/qpid/client/AMQSession.java b/client/src/main/java/org/apache/qpid/client/AMQSession.java
index cba764e..b5d4870 100644
--- a/client/src/main/java/org/apache/qpid/client/AMQSession.java
+++ b/client/src/main/java/org/apache/qpid/client/AMQSession.java
@@ -30,7 +30,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Set;
+import java.util.Objects;
import java.util.UUID;
import java.util.WeakHashMap;
import java.util.concurrent.ConcurrentHashMap;
@@ -150,8 +150,8 @@ public abstract class AMQSession<C extends BasicMessageConsumer, P extends Basic
*/
protected final boolean DAEMON_DISPATCHER_THREAD = Boolean.getBoolean(ClientProperties.DAEMON_DISPATCHER);
- private final Set<AMQDestination>
- _resolvedDestinations = Collections.synchronizedSet(Collections.newSetFromMap(new WeakHashMap<AMQDestination, Boolean>()));
+ private final Map<AMQDestination, AMQDestination>
+ _resolvedDestinations = Collections.synchronizedMap(new WeakHashMap<AMQDestination, AMQDestination>());
private final long _dispatcherShutdownTimeoutMs;
@@ -661,7 +661,7 @@ public abstract class AMQSession<C extends BasicMessageConsumer, P extends Basic
void setResolved(final AMQDestination dest)
{
- _resolvedDestinations.add(dest);
+ _resolvedDestinations.put(dest, dest);
}
void setUnresolved(final AMQDestination dest)
@@ -676,30 +676,22 @@ public abstract class AMQSession<C extends BasicMessageConsumer, P extends Basic
boolean isResolved(final AMQDestination dest)
{
- if (!_resolvedDestinations.contains(dest))
+ AMQDestination resolvedDest = _resolvedDestinations.get(dest);
+ if (resolvedDest == dest)
{
- return false;
- }
-
- if (dest.getAddressType() == AMQDestination.QUEUE_TYPE)
- {
- // verify legacy fields are set
- return dest.getQueueName() != null
- && dest.getQueueName().equals(dest.getAddressName())
- && dest.getExchangeName() != null
- && dest.getExchangeClass() != null
- && dest.getRoutingKey() != null;
+ return true;
}
- else if (dest.getAddressType() == AMQDestination.TOPIC_TYPE)
+ else if (resolvedDest == null)
{
- // verify legacy fields are set
- return dest.getExchangeName() != null
- && dest.getExchangeName().equals(dest.getAddressName())
- && dest.getExchangeClass() != null
- && (dest.getSubject() == null
- || (dest.getSubject() != null && dest.getSubject().equals(dest.getRoutingKey())));
+ return false;
}
- return false;
+
+ // verify legacy fields are equal
+ return Objects.equals(dest.getQueueName(), resolvedDest.getQueueName()) &&
+ Objects.equals(dest.getExchangeName(), resolvedDest.getExchangeName()) &&
+ Objects.equals(dest.getExchangeClass(), resolvedDest.getExchangeClass()) &&
+ Objects.equals(dest.getRoutingKey(), resolvedDest.getRoutingKey()) &&
+ Objects.equals(dest.getSubject(), resolvedDest.getSubject());
}
public abstract int resolveAddressType(AMQDestination dest) throws QpidException;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org