You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2021/05/11 18:57:10 UTC

[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #3569: ARTEMIS-3285 potential duplicate messages with LVQ + non-destructive

michaelandrepearce commented on a change in pull request #3569:
URL: https://github.com/apache/activemq-artemis/pull/3569#discussion_r630442808



##########
File path: artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/LastValueQueue.java
##########
@@ -350,25 +342,33 @@ public SimpleString getLastValueKey() {
       return Collections.unmodifiableSet(map.keySet());
    }
 
+   @Override
+   public boolean canBeDelivered(MessageReference ref) {
+      if (isNonDestructive() && ref instanceof HolderReference) {
+         return !((HolderReference)ref).isDelivered();
+      } else {
+         return true;
+      }
+   }
+
    private static class HolderReference implements MessageReference {
 
       private final SimpleString prop;
 
-      private volatile boolean delivered = false;
+      private volatile AtomicBoolean delivered = new AtomicBoolean(false);

Review comment:
       Theres a way to do something, ill try dig it out.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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