zhang-arvin opened a new pull request, #5316:
URL: https://github.com/apache/eventmesh/pull/5316

   ## What changes were proposed in this pull request
   
   Fix #5295: Gate RocketMQ 5 POP broker ACK on distribution completion.
   
   ### Problem
   Previously, a single `mqAck` callback was shared across all deliveries of a 
frame. In BROADCAST/MULTICAST mode, the first client ACK would immediately ACK 
the broker, even if other required targets had not yet received or acknowledged 
the message.
   
   ### Solution
   Introduce a broker-ACK barrier using an `AtomicInteger` counter:
   - All deliveries of the same frame share a single counter initialized to 
`targets.size()`
   - Broker ACK fires only when all deliveries have ACKed (counter reaches 0)
   - LOAD_BALANCE (1 target): 1 ACK → broker ACK
   - BROADCAST (N targets): N ACKs → broker ACK
   - MULTICAST (matched targets): all matched ACKs → broker ACK
   
   ### Changes
   - `eventmesh-runtime/.../UniIngressService.java`: Replace the shared `mqAck` 
callback with a barrier that counts down remaining ACKs before firing the 
broker ACK
   
   ### Verification
   - [ ] In BROADCAST mode, the first of multiple client ACKs does not ACK the 
POP message at the broker
   - [ ] The final required ACK executes exactly one broker ACK
   - [ ] Duplicate and out-of-order ACKs do not execute multiple broker ACKs 
(guarded by ReliableDispatcher.ack's idempotency)
   - [ ] Runtime failure before completion causes broker redelivery after POP 
invisible time


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to