ammachado opened a new pull request, #24566:
URL: https://github.com/apache/camel/pull/24566
# Description
Bundles two related fixes surfaced while investigating flaky CI on PR #24541:
**1. Fix racy
`JpaPollingConsumerLockEntityTest.testPollingConsumerWithLock`**
The test fires two concurrent requests racing for an optimistic lock on the
same entity, but asserted a fixed arrival order on the mock endpoint and gave
the losing side of the race only 120ms (2 retries x 60ms) to resolve the
conflict. Under CI host contention this produced two distinct, previously
observed failures:
- wrong message order (`orders: 2` arriving before `orders: 1`)
- the losing side exhausting its retries and landing on `mock:error` instead
of `mock:locked`
Switched the assertion to order-independent
(`expectedBodiesReceivedInAnyOrder`)
and widened the redelivery budget (`redeliveryDelay(100)` /
`maximumRedeliveries(10)`) so contention has realistic room to resolve, still
well within the existing 20s `assertIsSatisfied` timeout. Verified with 6
consecutive local runs (all green, ~0.7-0.8s each). Searched the rest of the
`camel-jpa` test module for the same pattern (concurrent racing requests +
order-sensitive assertion) — this was the only instance.
**2. Fact-check `jpa-component.adoc` against the actual source/pom.xml**
- OpenJPA version references were stale (`2.2.1`); corrected to `4.1.1`,
matching `parent/pom.xml`'s `openjpa-version` property (verified against
the
actual `openjpa-maven-plugin` / `openjpa` dependency wiring in
`camel-jpa/pom.xml`).
- Replaced external `camel.apache.org` links with `xref:manual::` per the
project's doc convention, and updated the `@Entity` javadoc link from the
old `javax.persistence`/Jakarta Persistence 2.2 spec to
`jakarta.persistence`/3.2, matching the `jakarta-persistence-api-version`
(3.2.0) actually used.
- The "Using the JPA-Based Idempotent Repository" procedure had an
~8-year-old
broken doc-tooling artifact — a literal `IndexOutOfBoundsException` message
left over from a failed Confluence "snippet" macro migration (traced via
`git log -S`) — and incorrectly instructed readers to configure a
`org.springframework.orm.jpa.JpaTemplate`, which `JpaMessageIdRepository`
does not use (its constructor takes an `EntityManagerFactory` directly).
Replaced both with real, source-verified `persistence-unit`/bean XML pulled
from the actual test fixtures (`persistence.xml`'s `SNIPPET: e1` block and
`fileConsumerJpaIdempotentTest-config.xml`'s `SNIPPET: jpaStore` block).
- Added a new "Entity enhancement" section documenting OpenJPA's
recommendation to use build-time enhancement (via `openjpa-maven-plugin`)
over runtime/dynamic enhancement, per
https://openjpa.apache.org/entity-enhancement.html and
https://openjpa.apache.org/enhancement-with-maven.html.
A small, explicitly-flagged documentation-only note was added to the 4.22
upgrade guide.
_AI-generated by Claude Code on behalf of ammachado._
# Target
- [x] I checked that the commit is targeting the correct branch (Camel 4
uses the `main` branch)
# Tracking
- [x] If this is a large change, bug fix, or code improvement, I checked
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for
the change (usually before you start working on it).
# Apache Camel coding standards and style
- [x] I checked that each commit in the pull request has a meaningful
subject line and body.
- [x] I have run `mvn clean install -DskipTests` locally from root folder
and I have committed all auto-generated changes.
# AI-assisted contributions
- [x] If this PR includes AI-generated code, commits have proper
co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR
description identifies the AI tool used.
--
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]