Open
Labels
enhancementNew feature or request
Description
Problem
Since #137 (2.0.0) OutboxProcessorListener events are published only after the processing transaction commits, and a batch whose commit fails emits nothing. That keeps the counters correct (okapi.entries.delivered / failed / retry.scheduled count only committed status changes), but now a failed batch is invisible to metrics: a commit that keeps failing (lost connection, serialization failure, timeout, or a delivery that throws inside the transaction) shows up only as log lines and a growing PENDING lag, and nothing tells the user why.
Proposal
- Add a callback to
OutboxProcessorListener, e.g.fun onBatchFailed(error: Throwable, duration: Duration) {}(default no-op), called byOutboxSchedulerwhenrunInTransaction { processBatch(...) }throws, which covers both a failingprocessBatchand a failing commit. - In
MicrometerOutboxListener, record anokapi.batch.failedcounter (optionally tagged with the exception class) and include failed batches inokapi.batch.durationwith anoutcometag, or record them under a separate timer. - Document it next to the existing counters in the README, and say that entries of a failed batch are not counted individually, because their status changes were rolled back.
Compatibility
Additive: a new interface method with a default implementation and a new meter. Fits a 2.x minor release.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity