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 2019/08/03 05:39:02 UTC

[GitHub] [activemq-artemis] franz1981 commented on a change in pull request #2703: ARTEMIS-2380 Fix delivering message in the case of consume close

franz1981 commented on a change in pull request #2703: ARTEMIS-2380 Fix delivering message in the case of consume close
URL: https://github.com/apache/activemq-artemis/pull/2703#discussion_r310339975
 
 

 ##########
 File path: artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
 ##########
 @@ -1175,6 +1179,17 @@ public void addConsumer(final Consumer consumer) throws Exception {
 
    }
 
+   @Override
+   public void addLingerRef(Consumer consumer, MessageReference lingerRef) throws Exception {
+      lingerRef.emptyConsumerID();
+      lingerRefMap.put(lingerRef, consumer);
 
 Review comment:
   Beware putting `MessageReference` into a `Map`: `MessageReferenceImpl::hashCode` relies on `getMessage().hashCode()` and `CoreMessage::hashCode` will use the native hash code (like `java.lang.System#identityHashCode`).
   It is known that it would break biased locking optimization on it (see https://blogs.oracle.com/dave/biased-locking-in-hotspot for more detail): given that `CoreMessage` heavily relies on `synchronized` operation, I would suggest to measure the perf impact of it first :+1: 

----------------------------------------------------------------
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


With regards,
Apache Git Services