Problem
When a consumer channel goes offline, DefaultReceiptHandleManager.clearGroup asynchronously renews each receipt handle with CLEAR_GROUP. The cleanup callback currently returns CompletableFuture.completedFuture(null) immediately instead of the RenewEvent future.
As a result, ReceiptHandleGroup removes the handle before the renewal outcome is known. If the renewal request fails, the handle is no longer retained or retried by the renewal scheduler.
Expected behavior
A receipt handle should be removed only after its CLEAR_GROUP renewal succeeds. On failure it should remain in the group so subsequent cleanup scheduling can retry it.
Proposed fix
Return the RenewEvent future from the ReceiptHandleGroup callback, mapping a successful result to null (remove) while preserving exceptional completion (retain). Add a regression test covering a failed offline cleanup renewal.
Scope
Proxy POP receipt-handle lifecycle; no protocol/API changes.
Problem
When a consumer channel goes offline,
DefaultReceiptHandleManager.clearGroupasynchronously renews each receipt handle withCLEAR_GROUP. The cleanup callback currently returnsCompletableFuture.completedFuture(null)immediately instead of theRenewEventfuture.As a result,
ReceiptHandleGroupremoves the handle before the renewal outcome is known. If the renewal request fails, the handle is no longer retained or retried by the renewal scheduler.Expected behavior
A receipt handle should be removed only after its
CLEAR_GROUPrenewal succeeds. On failure it should remain in the group so subsequent cleanup scheduling can retry it.Proposed fix
Return the
RenewEventfuture from theReceiptHandleGroupcallback, mapping a successful result tonull(remove) while preserving exceptional completion (retain). Add a regression test covering a failed offline cleanup renewal.Scope
Proxy POP receipt-handle lifecycle; no protocol/API changes.