Skip to content

GH-1906 - Allow resubmitting least recently attempted failed publications first - #1907

Open
AdzerKI wants to merge 1 commit into
spring-projects:mainfrom
AdzerKI:gh-1906-failed-publications-order
Open

AdzerKI wants to merge 1 commit into
spring-projects:mainfrom
AdzerKI:gh-1906-failed-publications-order

Conversation

@AdzerKI

@AdzerKI AdzerKI commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1906.

ResubmissionOptions.withLeastRecentlyAttemptedFirst() makes findFailedPublications(…) return the least recently attempted publications first: ordered by lastResubmissionDate, falling back to publicationDate for publications that were never resubmitted. The option reaches the repositories through FailedCriteria. JDBC and JPA use COALESCE in the query, Neo4j coalesce(…) in Cypher, MongoDB an aggregation with $ifNull as a plain sort can't express the fallback. Without the option, failed publications are still read oldest first.

With the option, a publication that was just resubmitted and failed again moves to the end of the queue, so publications that keep failing or are skipped by the resubmission filter no longer keep the others from being read.

Each repository test suite gets a test resubmitting the older of two failed publications and expecting it first by default and the newer one first with the option, in a batch of one. A registry unit test checks that the option ends up in FailedCriteria. events.adoc describes the default order and the option. The JDBC tests pass on H2, HSQLDB, PostgreSQL, MySQL, MariaDB, SQL Server and Oracle, the JPA, MongoDB and Neo4j suites pass as well.

…failed publications first.

Failed publications are read oldest first, so publications that keep failing or are skipped by the resubmission filter stay at the head of the queue and, once a full batch of them has piled up, keep all other failed publications from being resubmitted. ResubmissionOptions.withLeastRecentlyAttemptedFirst() now makes the repositories read them by the date of their last resubmission instead, falling back to the publication date for the ones never resubmitted. The default order is unchanged.

Signed-off-by: AdzerKI <silver_cat@list.ru>
@AdzerKI
AdzerKI force-pushed the gh-1906-failed-publications-order branch from be03f23 to 464037b Compare October 9, 2026 18:07
@AdzerKI AdzerKI changed the title GH-1906 - Resubmit least recently attempted failed publications first GH-1906 - Allow resubmitting least recently attempted failed publications first Oct 9, 2026
@AdzerKI

AdzerKI commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Reworked as discussed in #1906: the new order is now opt-in through ResubmissionOptions.withLeastRecentlyAttemptedFirst(), and failed publications are still read oldest first by default.

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.

Failed event publications that are skipped or keep failing block resubmission of all others

1 participant