[ 
https://issues.apache.org/jira/browse/ARTEMIS-2212?focusedWorklogId=186343&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-186343
 ]

ASF GitHub Bot logged work on ARTEMIS-2212:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 17/Jan/19 15:13
            Start Date: 17/Jan/19 15:13
    Worklog Time Spent: 10m 
      Work Description: clebertsuconic commented on pull request #2480: 
ARTEMIS-2212 Avoid using CLQ on ServerConsumerImpl
URL: https://github.com/apache/activemq-artemis/pull/2480#discussion_r248709999
 
 

 ##########
 File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java
 ##########
 @@ -509,21 +518,16 @@ public synchronized void close(final boolean failed) 
throws Exception {
 
       removeItself();
 
-      LinkedList<MessageReference> refs = cancelRefs(failed, false, null);
-
-      Iterator<MessageReference> iter = refs.iterator();
+      List<MessageReference> refs = cancelRefs(failed, false, null);
 
       Transaction tx = new TransactionImpl(storageManager);
 
-      while (iter.hasNext()) {
-         MessageReference ref = iter.next();
-
+      refs.forEach(ref -> {
 
 Review comment:
   Ohhh... ok.. it's on the list from cancelRefs.. I confused as being the main 
list.
 
----------------------------------------------------------------
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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 186343)
    Time Spent: 20m  (was: 10m)

> Avoid using CLQ on ServerConsumerImpl
> -------------------------------------
>
>                 Key: ARTEMIS-2212
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2212
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>    Affects Versions: 2.7.0
>            Reporter: Francesco Nigro
>            Assignee: Francesco Nigro
>            Priority: Minor
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> ServerConsumerImpl is using a ConcurrentLinkedQueue that can be avoided to be 
> used considering that any accesses is guarded by a lock.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to