activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From franz1981 <...@git.apache.org>
Subject [GitHub] activemq-artemis pull request #2490: V2 196
Date Wed, 09 Jan 2019 13:22:28 GMT
Github user franz1981 commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2490#discussion_r246377787
  
    --- Diff: artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
---
    @@ -2497,45 +2484,36 @@ private void deliver() {
     
     
                       handled++;
    -
    +                  consumers.reset();
                       continue;
                    }
     
                    if (logger.isTraceEnabled()) {
                       logger.trace("Queue " + this.getName() + " is delivering reference
" + ref);
                    }
     
    -               // If a group id is set, then this overrides the consumer chosen round-robin
    -
    -               SimpleString groupID = extractGroupID(ref);
    -
    -               if (groupID != null) {
    -                  groupConsumer = groups.get(groupID);
    +               final SimpleString groupID = extractGroupID(ref);
    +               groupConsumer = getGroupConsumer(groupConsumer, groupID);
     
    -                  if (groupConsumer != null) {
    -                     consumer = groupConsumer;
    -                  }
    -               }
    -
    -               if (exclusive && redistributor == null) {
    -                  consumer = consumerList.get(0).consumer;
    +               if (groupConsumer != null) {
    +                  consumer = groupConsumer;
                    }
     
                    HandleStatus status = handle(ref, consumer);
     
                    if (status == HandleStatus.HANDLED) {
     
    -                  deliveriesInTransit.countUp();
    -
    -                  handledconsumer = consumer;
    -
    -                  removeMessageReference(holder, ref);
    -
                       if (redistributor == null) {
                          handleMessageGroup(ref, consumer, groupConsumer, groupID);
                       }
     
    +                  deliveriesInTransit.countUp();
    +
    +
    +                  removeMessageReference(holder, ref);
    +                  handledconsumer = consumer;
                       handled++;
    +                  consumers.reset();
    --- End diff --
    
    if `removeMessageReference` would throw any exeption is fine to have `consumers.reset`
not called?
    if not, uses `try...finally`


---

Mime
View raw message