Skip to content

feat(#1797): add message delivery tracking to QueueMessageReference#1796

Open
jeanouii wants to merge 1 commit intoapache:mainfrom
jeanouii:feat/message-delivery-tracking
Open

feat(#1797): add message delivery tracking to QueueMessageReference#1796
jeanouii wants to merge 1 commit intoapache:mainfrom
jeanouii:feat/message-delivery-tracking

Conversation

@jeanouii
Copy link
Contributor

Add isDelivered()/setDelivered() to QueueMessageReference interface with implementations in IndirectMessageReference (boolean field) and NullMessageReference (no-op). PrefetchSubscription.acknowledge() now marks messages as delivered=true when processing DeliveredAck, enabling downstream consumers to distinguish delivered-but-unacked messages.

Add isDelivered()/setDelivered() to QueueMessageReference interface
with implementations in IndirectMessageReference (boolean field) and
NullMessageReference (no-op). PrefetchSubscription.acknowledge() now
marks messages as delivered=true when processing DeliveredAck, enabling
downstream consumers to distinguish delivered-but-unacked messages.
@jeanouii jeanouii changed the title [#RODO] feat(#TODO): add message delivery tracking to QueueMessageReference feat(#1797): add message delivery tracking to QueueMessageReference Mar 18, 2026
private boolean dropped;
/** Has the message been acked? */
private boolean acked;
/** Has the message been acked? */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The javadoc doesn't seem correct to me. I think it's a copy from acked javadoc.

Suggested change
/** Has the message been acked? */
/** Has the message been delivered? */.

}

@Override
public boolean isDelivered() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it should be synchronized.

Suggested change
public boolean isDelivered() {
public synchronized boolean isDelivered() {

return delivered;
}

public void setDelivered(final boolean delivered) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it should be synchronized.

Suggested change
public void setDelivered(final boolean delivered) {
public synchronized void setDelivered(final boolean delivered) {

return delivered;
}

public void setDelivered(final boolean delivered) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Override seems missing here.

Suggested change
public void setDelivered(final boolean delivered) {
@Override
public void setDelivered(final boolean delivered) {

}

int index = 0;
for (Iterator<MessageReference> iter = dispatched.iterator(); iter.hasNext(); index++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this loop overrides what has been done in the previous loop (line 275). Maybe we should merge the logic in one loop ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants