Skip to content

Add routes for platform-driven automatic DLQ retries#162

Open
stefanmirkovic wants to merge 1 commit into
mainfrom
feature/dlq-automatic-retry-routes
Open

Add routes for platform-driven automatic DLQ retries#162
stefanmirkovic wants to merge 1 commit into
mainfrom
feature/dlq-automatic-retry-routes

Conversation

@stefanmirkovic

Copy link
Copy Markdown
Contributor

Supports automatic DLQ retries in the platform (AxonIQ/axoniq-platform#731). The client owns due-sequence filtering and attempt counting, since the framework doesn't track retries by default.

@stefanmirkovic stefanmirkovic self-assigned this Jul 15, 2026
@stefanmirkovic stefanmirkovic added the Backend This issue contains backend changes label Jul 15, 2026
@sonarqubecloud

Copy link
Copy Markdown

fun automatedRetry(processingGroup: String, messageIdentifier: String): Boolean {
val entry = dlqFor(processingGroup)
val success = entry.processor.process { it.message().identifier() == messageIdentifier }
.get(60, TimeUnit.SECONDS)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A client-side timeout here escapes the retry budget. process { … }.get(60, SECONDS) throws TimeoutException when a sequence takes longer than 60s to process, rather than returning false — so the if (!success) branch never runs, registerFailedAutomatedAttempt is skipped, and __platform_retries is never incremented.

The effect: a sequence that consistently fails by being slow (>60s) is retried every scheduled round forever and never counts toward maxRetries. The platform side (DlqRetryExecutor.retry, timeoutSeconds = 90) just catches the resulting error and moves on, so nothing upstream compensates.

Suggest catching the TimeoutException around the .get(...) and treating it as success = false, so a timed-out attempt flows through the existing failure path (bumps the counter) and returns false like any other failed attempt. Worth a test for the "slow sequence eventually exhausts its budget" case.

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

Labels

Backend This issue contains backend changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants