activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] jbertram commented on a change in pull request #2510: [ARTEMIS-2156] Message Duplication when using exclusive divert and clustering
Date Mon, 21 Jan 2019 20:31:48 GMT
jbertram commented on a change in pull request #2510: [ARTEMIS-2156] Message Duplication when
using exclusive divert and clustering
URL: https://github.com/apache/activemq-artemis/pull/2510#discussion_r249572071
 
 

 ##########
 File path: artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/BindingsImpl.java
 ##########
 @@ -117,7 +117,9 @@ public void addBinding(final Binding binding) {
             logger.trace("addBinding(" + binding + ") being called");
          }
          if (binding.isExclusive()) {
-            exclusiveBindings.add(binding);
+            if (!exclusiveBindings.contains(binding)) {
 
 Review comment:
   @michaelandrepearce, according to the [JavaDoc](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CopyOnWriteArraySet.html)
order is maintained as you note. However, `getNextBinding` indexes into the list so changing
to a set would require that method to be refactored substantially. I think it's probably safer
just to make the contains/add atomic than to change to a set.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message