AntonRoskvist commented on code in PR #4659:
URL: https://github.com/apache/activemq-artemis/pull/4659#discussion_r1393218874


##########
artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java:
##########
@@ -517,7 +517,6 @@ public void removeRolledback(MessageReference 
messageReference) {
    }
 
    public void addRolledback(MessageReference messageReference) {
-      currentWindow.decrementAndGet();

Review Comment:
   Quite interesting... I have actually noticed queue counters (metrics) being 
incorrect from time to time on queues using OW consumers... in particular ones 
using XA-transactions. This type of application is getting exceedingly rare in 
the envs I manage, and it has not happened often enough to warrant further 
investigation, but it is something I have seen multiple times. Guessing it 
could have a common source to this as well.
   
   For the added test you mentioned though, I found it to behave pretty much as 
I would expect it to, besides prefetch being of-by-one (which I guess might be 
expected given the rollback, not sure). 
   
   The error I am getting is caused by a null value returned from the 
receive-call, which happens because some message gets moved over to DLQ after 
exceeding "maximumRedeliveries"... so this is the expected result given the 
queue is empty.
   
   Setting `connection.getRedeliveryPolicy().setMaximumRedeliveries(-1);` makes 
the test pass.
   
   Additionally I ran with `queueControl.getDeliveringCount()` printed for each 
loop iteration and prefetch never exceeds prefetchPolicy + 1.
   
   
   I'm not sure about this next part at all: 
   From what I recall from last time I looked at this, I think I interpreted 
the incorrect `currentWindow` and `prefetch` values to be caused by from some 
difference in how OW handled redeliveries compared to Core... something about 
the OW client holding on to the message for each redelivery but also notifying 
the broker each time about the redelivery, whereas for Core the message 
actually "bounces" back and forth for each delivery. 



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to