michaelandrepearce 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_r249592329
##########
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:
@jbertram i agree for scope of this PR simply the changing exclusiveBindings
to CopyOnWriteArraySet is enough.
I was merely commenting about the ordering behaviour of the set, i probably
confused things.
Just an FYI if you cast the bindings to CopyOnWriteArrayList, then you can
replace the
if (!bindings.contains(binding)) {
bindings.add(binding);
}
with
bindings.addIfAbsent(binding);
to make it concurrent safe.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services