Repository navigation
CAMEL-24172: Add camel-apicurio-registry component - #24844
carlesarnal wants to merge 10 commits into
Conversation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
there are seveal modules to regen: |
Yes, this is in draft still, I'm still wrapping my head around a few things on how to structure different elements. Thanks! |
0780ba9 to
218e2c1
Compare
Grok code reviewVerdict: Approve with improvements — well-structured new component with appropriate SDK delegation, generated metadata, and meaningful test coverage. ArchitectureGood separation; SDK types stay at the boundary. Strengths
Follow-ups (see inline Grok threads)
Test coverage
RecommendationReady for committer review. Suggest reviewers with registry/cloud component experience (e.g. recent schema/registry contributors). AI-generated Grok review on behalf of atiaomar1978-hub. |
Bugbot reviewReviewed ScopeNew Preview component wrapping Apicurio Registry v3 REST API via Verified (looks good)
Issues flagged (inline comments posted)
Bugbot verdict: Solid first component drop — approve with follow-ups above before Preview promotion. No security blockers (producer is trusted route config; consumer polls configured registry). AI-generated Bugbot review on behalf of atiaomar1978-hub. |
Bugbot — test coverage reviewAssessed unit + IT coverage for Coverage matrix (producer operations)
Consumer coverage
Config / auth
VerdictAdequate for Preview merge — strong lifecycle IT and good mocked coverage for core CRUD. Not yet comprehensive for a GA component: three producer ops lack unit tests, validation/compatibility negative paths are thin, consumer watermark/ Priority additions before promotion:
AI-generated Bugbot test-coverage review on behalf of atiaomar1978-hub. |
Grok — test coverage reviewVerdict: Good foundation, gaps on edge cases and half the producer surface at unit level What is well covered
Gaps by risk
Test quality notes
Scorecard
AI-generated Grok test-coverage review on behalf of atiaomar1978-hub. |
|
Thanks @davsclaus. All three are addressed in 9ffb472, on top of the rebased branch.
From the minor points: tests now use The docs and generated catalog/DSL files are updated. Locally, 42 unit tests and 8 integration tests pass. AI-assisted response prepared with OpenCode on behalf of @carlesarnal. |
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-review of 9ffb47280a07 — all three @davsclaus items addressed, plus the outstanding gnodet-bot finding from the previous round.
Addressed ✅
-
Failed version retry — Consumer now checks
exchange.getException()afterprocess(). When the error handler handles the exception (sets it on the exchange without rethrowing), the consumer reports it viagetExceptionHandler(), stops the poll, and leaves the watermark unchanged so the version retries on the next poll.testRouteFailureHandledByErrorHandlerIsRetriedconfirms version 1 fails once, then both 1 and 2 arrive in order. -
Pagination — Consumer pages newest-first (
SortOrder.Desc,PAGE_SIZE=100), stops at the watermark.TreeMap<Long, SearchedVersion>deduplicates if a new version shifts pages mid-request.testPollPagesThroughManyVersionsAndStopsAtWatermarkcovers 250 versions across 3 pages and verifies the watermark cuts off older pages on the next poll. Producer'slistVersionsalso follows all pages (ascending).FakeVersionPagesis a well-designed test helper that simulates the registry's sort/offset/limit behavior. -
Shared Vert.x — Single
Vertxper component, created lazily (getOrCreateVertx()), closed ondoStop()withsynchronizedguard and 30s timeout. Caller-supplied Vert.x viasetVertx()is never closed. Tests confirm shared instance across endpoints (testEndpointsShareComponentVertxClosedWithComponent) and that a provided instance is left alone (testProvidedVertxIsNotClosed). -
testCompatibilitynow setsHEADER_VALIDATION_RESULT— our previous finding is addressed; bothvalidateandtestCompatibilityset the header, with matching test assertions. -
camel-test-junit6migration — all test classes updated. -
camel-test-infra-allregistration — as @davsclaus requested.
Code is solid. No new issues found.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
davsclaus
left a comment
There was a problem hiding this comment.
Thanks for the thorough update. All the earlier points are addressed: a failed version is no longer skipped (the watermark only advances on success, with a route test), version lists are paged in both the consumer and listVersions, the component shares one Vert.x (and never closes one the user supplies), the tests use camel-test-junit6, and the test-infra is registered.
One new issue worth fixing before merge, and a few smaller ones:
- WebClient leak (inline): each endpoint start creates a Vert.x
WebClientthat is never closed. setVertx()(inline): supplying a Vert.x after the component created its own leavesmanagedVertxtrue, sodoStop()closes the user's instance.- A version that always fails is retried on every poll and blocks all newer versions. That is the behaviour I asked for, but please document how to skip it (
onException(...).handled(true)advances the watermark). The failure is also logged twice (error handler andgetExceptionHandler()). - Offset paging can skip an entry if a version is deleted between page requests, and the watermark then moves past it. Rare; a docs note is enough.
- Nit: the
lastSeenGlobalId == null || globalId > lastSeenGlobalIdcheck in the consumer is now redundant.
(CI has now been approved to run.)
Claude Code on behalf of davsclaus
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-review of 9ffb47280a0 — all previous findings addressed. Clean APPROVE for this Preview component.
Previous findings status
| Finding | Status |
|---|---|
Side-effect HEADER_VALIDATION_ERRORS in testCompatibility |
✅ Addressed — author chose option (b): both testCompatibility and validate now set HEADER_VALIDATION_RESULT, and the error header is documented for both operations. Header description updated to "Cleared before each check." |
Exchange pooling leak (createExchange without releaseExchange) |
✅ Addressed — consumer uses createExchange(false) paired with releaseExchange(exchange, false) in a finally block. Pooled-exchange tests verify cleanup. |
Empty group-ID parsing (split("/") leaving empty string) |
✅ Addressed — parts[0].isEmpty() ? null : parts[0] normalizes empty strings. Parsing tests added for /someArtifact case. |
Latest changes reviewed (9ffb472)
- Consumer error handling —
exchange.getException()checked after processing; on failure, error reported viagetExceptionHandler(), poll stops without advancing watermark (version retried next cycle). Correct pattern. - Pagination —
fetchNewVersions()requests pages newest-first withSortOrder.Desc, stops at watermark, deduplicates viaTreeMap<Long, SearchedVersion>, returns ascending order.listVersionsproducer follows every page. Both correct. - Vert.x lifecycle — single instance per component,
synchronizedcreation, outside-lock close indoStop()with 30s timeout. Caller-suppliedVertxleft open. Correct. - Test infra — registered in
camel-test-infra-all(dependency, jandex, metadata, catalog).camel-test-junit6used throughout.
Solid Preview component — well structured, good test coverage (42 unit + 8 IT), clean Camel conventions.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
oscerd
left a comment
There was a problem hiding this comment.
Thanks for the thorough iterations, Carles. Every point from my 2026-09-14 change request is resolved at 9ffb472: both module parents are 4.23.0-SNAPSHOT, the generated catalog/DSL files are committed and match the module sources, CAMEL-24172 is linked, firstVersion/:since: are 4.23, the tests use AssertJ, the quay.io image covers amd64/arm64/ppc64le/s390x, and username/clientId are no longer secret. CI is green, the component is well structured, it has no unsafe deserialization, and the consumer sets only a fixed set of headers. I'm keeping changes requested for one new consumer bug: with fetchContent=true, a DISABLED version permanently stalls delivery. I'd also like searchArtifacts to stop silently truncating at 20 results. davsclaus's WebClient-leak and setVertx threads are still open at this head; the remaining findings are minor.
Claude Code on behalf of oscerd. This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying. It does not replace specialized review tools or static analysis.
|
Thanks both. I pushed 9ef714c and replied on each inline thread. @davsclaus, for the points outside the inline threads:
@oscerd, all of your points are addressed: DISABLED and missing versions with fetchContent, searchArtifacts filtering and paging, Locally, 53 unit tests and 8 integration tests pass. The generated catalog and DSL files are updated. AI-assisted response prepared with OpenCode on behalf of @carlesarnal. |
oscerd
left a comment
There was a problem hiding this comment.
Thanks Carles, all eight points from my previous review are fixed at 9ef714c, and I checked each in the code and tests. DISABLED/404 versions no longer stall fetchContent=true (other errors are still retried). searchArtifacts filters by artifact ID/type/labels and has offset/limit/order headers. Secrets use security = "secret". Missing IDs fail fast. An idle poll is a single limit=1 probe. TLS/proxy options exist, and the docs cover artifact deletion and consumer-header precedence. davsclaus's WebClient-leak and setVertx threads look addressed too, and the generated files match the sources. No CI has run on this head yet (the workflows are waiting for approval), so I'll approve once it is green. The three new points below are minor and can be follow-ups.
Claude Code on behalf of oscerd. This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying. It does not replace specialized review tools or static analysis.
davsclaus
left a comment
There was a problem hiding this comment.
Thanks @carlesarnal, all my points from the last round are addressed: each endpoint now builds and closes its own WebClient (and the OAuth2 provider), setVertx() never closes a user-supplied Vert.x while still closing the one the component created, the docs explain how to skip a version that always fails with onException(...).handled(true) and mention the offset-paging caveat, the double logging is gone (isErrorHandlerHandledSet()), and the redundant watermark check is removed. I also checked oscerd's 2026-10-06 points in the code, and they are all fixed. CI is green on 9ef714c.
Before merge:
- Please rebase onto main and regenerate. The branch is based on a commit from before CAMEL-25407 (#27474), which changed the UriFactory generator, so
ApicurioRegistryEndpointUriFactoryis generated differently on current main (inline) and main's uncommitted-changes check would fail after merge. It merges without conflicts, so it should only be a rebase plusmvn installin the module. - I agree with oscerd's three comments from today: Basic/OIDC credentials are no longer validated now that the SDK takes the
customWebClientpath, skips are logged only at DEBUG, and the dependency tree hasvertx-core4.5.34 next tovertx-web-client/vertx-auth-oauth24.5.26 (viakiota-http-vertx). Declaringvertx-web-clientandvertx-auth-oauth2with${vertx-version}would fix the last one.
A few small ones inline. With the rebase and the credential fail-fast, I'm happy to approve this for 4.23 as a Preview component.
Claude Code on behalf of davsclaus. This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
oscerd
left a comment
There was a problem hiding this comment.
Re-reviewed at head 9ef714c5. All eight points from my 2026-10-06 review are genuinely fixed — I verified each in the code rather than taking my own earlier follow-up on trust:
| # | Item | Evidence at head |
|---|---|---|
| 1 | fetchContent=true stalls on a DISABLED version |
ApicurioRegistryConsumer.java:65-70 skips VersionState.DISABLED and advances lastSeenGlobalId; :121-134 returns null only on HTTP 404 and rethrows otherwise, so transient 5xx still retry |
| 2 | searchArtifacts truncates at 20, ignores artifact ID |
ApicurioRegistryProducer.java:182-212 now honours artifactId, artifactType, labels, offset, limit, order, orderby |
| 3 | Deprecated secret = true |
ApicurioRegistryConfiguration.java:47,56,93 all use security = "secret"; none left |
| 4 | Consumer headers override a downstream producer's URI path | Documented at apicurio-registry-component.adoc:107-117 with the removeHeaders("CamelApicurioRegistry*") example. Behaviour unchanged — a reasonable call |
| 5 | Fail fast on missing group/artifact IDs | ApicurioRegistryEndpoint.createConsumer():86-89 throws at route start |
| 6 | Idle polls download 100 versions every 500 ms | ApicurioRegistryConsumer.java:145-151 does a limit = 1 probe first |
| 7 | No TLS / proxy configuration | ApicurioRegistryConfiguration.java:79-94 adds sslContextParameters (wired via VertxHelper.setupSSLOptions) plus proxy options. Correctly no trustAll knob, so no security = "insecure:ssl" is owed |
| 8 | Document that the registry must allow deletion | apicurio-registry-component.adoc:64 covers apicurio.rest.deletion.artifact.enabled and the 405 otherwise |
Eight substantive findings turned around in a single iteration, on a PR open since July — that is a good showing, and every one of them checks out.
The new-component checklist is also clean: direct child of components/ so no MojoHelper registration is needed (correctly absent); catalog JSON and docs mirrors are byte-identical to the module copies; camel-bom, camel-allcomponents, parent/pom.xml and ArtifactUtils entries all present; tests are AssertJ-only with no mixing and no Thread.sleep; and the container image quay.io/apicurio/apicurio-registry:3.3.0 publishes amd64, arm64, s390x and ppc64le (I queried the quay manifest list), so no skipITs.* is needed.
I'm keeping the block, but re-scoped to two things
1. The branch is 952 commits behind main, and the green CI is stale in a way that matters. All 7 checks pass on 9ef714c, but that run completed 2026-10-07 08:20Z and CAMEL-25407 (#27474, c9737a20e661) merged at 08:33Z — thirteen minutes later. That commit changed the EndpointUriFactory generator, and I confirmed the drift directly:
this PR: Map<String, Object> copy = new HashMap<>(properties);
current main: Map<String, Object> copy = copyParameters(properties);
So the uncommitted-changes gate will fail on rebase. Please rebase onto current main, regenerate, commit, and let CI re-run. I checked the catalog JSON key set against a current-main component and found no further drift, but 952 commits touch several packaging mojos, so a full mvn clean install after the rebase is the only safe answer.
2. @davsclaus' auth findings from 2026-10-07 post-date the last commit and are still open. The one I would most want closed: with authType=basic and no username/password, ApicurioRegistryEndpoint builds Base64("null:null") and sends Authorization: Basic bnVsbDpudWxs on every request — silent 401s rather than a startup failure. An unknown authType (a typo like oauth) likewise falls through to the bare webClient with auth silently disabled. A single validation block in createWebClient fixes both, plus the related WebClient leak if OAuth2Auth.create throws.
Two prior claims I checked and would not pass on
- @gnodet-bot's re-raised "
testCompatibilitydoes not setHEADER_VALIDATION_RESULT" is false at head —ApicurioRegistryProducer.java:290sets it. Stale thread, just needs resolving. - @gnodet-bot's "
getServiceProtocol()returns"http"— wrong identifier" is not a defect: 8 components on main return the literal"http", and theEndpointServiceLocationjavadoc gives "http, amqp, tcp" as examples.
Merge housekeeping for later
CAMEL-24172 is Open, unassigned, fixVersions empty — it needs assigning to @carlesarnal with fixVersions = 4.23.0 set before closing. There are also ~26 unresolved threads (mostly stale bot ones) that need a sweep, since unresolved conversations block merge.
Happy to approve as soon as the rebase is green and the auth fail-fast is in.
Reviewed with Claude Code (Claude Opus 5) on behalf of @oscerd. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying. It is a rules-and-conventions review and does not replace CodeRabbit, Sourcery, or SonarCloud.
9ef714c to
e828c1e
Compare
gnodet-bot
left a comment
There was a problem hiding this comment.
Following up on my earlier reviews — all three previously open findings are now addressed.
HEADER_VALIDATION_RESULT not set by testCompatibility — ✅ addressed. Both testCompatibility() and validate() now set the header symmetrically via doDryRun(), with unit tests (testTestCompatibilitySuccess, testTestCompatibilityFailure) verifying the header value for both outcomes.
Unbounded versions().get() — silent data loss on 20+ versions — ✅ addressed. fetchNewVersions() paginates 100 at a time, newest-first, with a cheap limit=1 probe to skip full pagination on idle polls. listVersions() paginates identically. FakeVersionPages simulates real registry default-page behaviour (20 entries) and tests verify correct offsets for 250 versions.
I also reviewed the new changes in this push (e828c1e5f9c): credential validation in doStart(), unknown authType rejection, NoCookieStore for Basic auth sessions, OAuth2WebClient flow on credentials (not the deprecated OAuth2Options), and explicit Vert.x web-client/auth version alignment. No issues found. The resource cleanup path for the OIDC OAuth2Auth instance is correctly handled by closeOwnedResources() (it checks ownedWebClient and oauth2 independently), and notFoundGlobalId is safe without volatile because ScheduledPollConsumer uses a single-thread executor.
LGTM.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
|
Thanks @oscerd and @davsclaus. I've pushed e828c1e, rebased onto current main.
Locally, 63 unit tests and 8 integration tests pass. I resolved the 18 older threads you both confirmed as fixed, including the stale bot ones, and left this round's threads open for you. JIRA: I'll assign CAMEL-24172 to myself and set fixVersions to 4.23.0 before it is closed. AI-assisted response prepared with OpenCode on behalf of @carlesarnal. |
|
CI on e828c1e is green apart from AI-assisted response prepared with OpenCode on behalf of @carlesarnal. |
davsclaus
left a comment
There was a problem hiding this comment.
Claude Code on behalf of davsclaus
Thanks @carlesarnal. The rebase and the last round of fixes are in, and I checked each one against the code at e828c1e:
ApicurioRegistryEndpointUriFactoryis regenerated on current main (copyParameters(properties)), and thebuildjobs pass on the rebased head with no uncommitted changes.validateAuthentication()makes the endpoint fail on start when Basic or OIDC credentials are missing orauthTypeis unknown. The plainWebClientis closed ifOAuth2Auth.createthrows, and the parameterized test covers every missing option.- The OAuth2 flow is now set on
Oauth2Credentials, so the deprecatedOAuth2Options.setFlowcall is gone. NoCookieStorekeeps response cookies out of the Basic-auth session, and the HTTP test checks that the second request sends no cookie.ifExistsgoes throughparseEnum, so an unknown value fails with a clear message.- A content 404 is retried once on the next poll before the version is skipped with a WARN. The version list is ordered by globalId, so the retry hits the same version first. The docs say that skipped versions are not delivered again.
vertx-web-clientandvertx-auth-oauth2are declared with${vertx-version}.
I resolved my five threads. oscerd's three threads are addressed in the same commit too, but I'll leave them for him to resolve.
On CI, the only red check is license-check. It fails while downloading develocity-maven-extension from Maven Central (Connection reset), so it's an infrastructure flake and not caused by this PR. A re-run should clear it.
Before merging, CAMEL-24172 needs an assignee and fixVersions set before the issue is closed.
Approving as a Preview component. Thanks for sticking with this through so many review rounds.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
oscerd
left a comment
There was a problem hiding this comment.
TL;DR
All of my earlier points are fixed at e828c1e and the new commit reads well. However, main cut 4.23.0 and moved to Vert.x 5.2.1 on 2026-10-15, the day after this branch was last rebased, so we need one more rebase before merging. Nothing in the PR caused this.
Blockers
- Stale 4.23 versions. The module parents (
components/camel-apicurio-registry/pom.xml:27,test-infra/camel-test-infra-apicurio-registry/pom.xml:25) and the generatedbom/camel-bom/pom.xml:142entry still say4.23.0-SNAPSHOT, while main has been4.24.0-SNAPSHOTsince 5686684 (#27901). GitHub shows no conflict because these are added lines, but the merged build cannot resolve those parents: it is the sameNon-resolvable parent POMfailure as in my first review. 4.23.0 has shipped without this component, sofirstVersion(ApicurioRegistryEndpoint.java:53) and:since:(apicurio-registry-component.adoc:6) should become4.24.0/4.24, ascamel-test-citrusdid. A full regen then updates the catalog JSON,component.properties, the test-infra metadata and theSince:line in the DSL javadoc. - No CI on Vert.x 5 yet. CAMEL-23647 (#27825) moved
vertx-versionfrom 4.5.35 to 5.2.1. After the rebase,pom.xml:52,57andcamel-vertx-commonresolve to 5.2.1, but the SDK's adapter (kiota-http-vertx0.0.35, from Apicurio 3.3.0 on Quarkus 3.33.1) is built for Vert.x 4.5. I checked the 5.2.1 sources: the endpoint's own calls and the adapter'scustomWebClientpath (requestAbs,send,sendBuffer,toCompletionStage) all still exist.OAuth2Options.setFlowis gone in 5.2.1, so moving the flow toOauth2Credentialswas the right call. I expect CI to pass, but we need to see it pass. If it fails, thecamel-arangodbnote in the 4.24 upgrade guide is the precedent.
Other findings: 3 non-blocking (1 suggestion, 1 question, 1 Jira note)
Follow-up on my earlier comments
- 2026-09-14 (parents, generated files, Jira, AssertJ, image architectures,
username/clientId): still fixed, apart from the version numbers above. The quay3.3.0manifest still lists amd64, arm64, ppc64le and s390x. - 2026-10-06 (eight inline points): still fixed. e828c1e keeps the DISABLED skip and refines the 404 path.
- 2026-10-07: fixed. Missing credentials now fail the endpoint start (
ApicurioRegistryEndpoint.java:154-207, with the six-case test and the WebClient-close test). DISABLED skips log at INFO, a repeated 404 logs at WARN, the docs say skipped versions are not delivered again, and the Vert.x libraries use${vertx-version}. - 2026-10-12: the rebase/regen (
copyParameters) and the auth fail-fast are done, and all review threads are resolved.
New
- [Suggestion]
ApicurioRegistryConsumer.java:95-101: withgreedy=true,ScheduledPollConsumerpolls again at once after a poll that delivered a version. So the "retry on the next poll" can come milliseconds later, and a version on a lagging replica is then skipped for good. A doc line would help, or the consumer could give up only oncedelayhas passed since the first 404, which keeps the wait. - [Question]
parent/pom.xml:82: is SDK3.3.0deliberate?3.3.3is the latest patch on Central. If there is no reason to stay on 3.3.0, bumping the SDK and the test image tag together during the rebase would start the component on the latest fixes. - CAMEL-24172 is still Open, unassigned and has no
fixVersions. The target is now4.24.0, not the4.23.0planned on 10-14.
Happy to approve once the rebased head is green.
Reviewed with Claude Code on behalf of oscerd. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.
New Camel component wrapping the Apicurio Registry v3 REST API via the apicurio-registry-java-sdk. Assisted by Claude, model: claude-opus-4-6
Assisted by Claude, model: claude-opus-4-6
- Remove unused cacheTtl option and HEADER_DRY_RUN constant - Sort versions by globalId before processing in consumer - Convert InputStream to byte[] in getArtifactContent to avoid leaks - Extract shared doDryRun helper for testCompatibility/validate - Catch only ApiException in dry-run operations, rethrow others - Move apicurio-registry-sdk-version property to parent/pom.xml - Document consumer first-start replay behavior in .adoc - Add unit tests for searchArtifacts, testCompatibility, validate - Add consumer unit test for out-of-order globalId sorting - Improve validate IT assertions Assisted by Claude, model: claude-opus-4-6
Assisted by Claude, model: claude-opus-4-6
Update to Camel 4.23 and regenerate catalog, BOM, documentation and DSL files. Manage SDK resources, preserve injected clients, distinguish rule violations from infrastructure failures, and expand authentication, validation and consumer coverage. Co-authored-by: GitHub Copilot <copilot@github.com>
Use manual pooled exchange release on success and failure, preserve retries after failed processing, normalize empty group IDs, and document compatibility error headers with regression coverage. Co-authored-by: GitHub Copilot <copilot@github.com>
The consumer no longer advances its watermark when the route error handler records a failure, version lists are paged instead of truncated at the registry default, and endpoints share one component-level Vert.x instance. testCompatibility also sets the result header. Tests move to camel-test-junit6 and the test infra is registered in camel-test-infra-all. Co-authored-by: GitHub Copilot <copilot@github.com>
…rches Endpoints now own and close their Vert.x WebClient (and OAuth2 provider), with TLS and proxy options. setVertx no longer lets the component close a user instance. The consumer skips disabled or missing versions when fetching content, probes before paging, fails fast on missing IDs and avoids logging failures twice. searchArtifacts applies the artifact ID and other filters and exposes paging and sorting headers. Producer operations report missing IDs clearly, and the docs cover deletion, consumer headers and retry behaviour. Co-authored-by: GitHub Copilot <copilot@github.com>
…gn Vert.x Rebased on main and regenerated the endpoint URI factory. The endpoint fails to start on missing Basic/OIDC credentials or an unknown authType, closes its WebClient when OAuth2 setup fails, avoids the deprecated OAuth2 flow option and keeps no cookies. A 404 for version content is retried once before the version is skipped with a warning. Unknown ifExists values fail clearly, and the Vert.x client libraries are declared with the Camel Vert.x version. Co-authored-by: GitHub Copilot <copilot@github.com>
e828c1e to
3aada5b
Compare
gnodet-bot
left a comment
There was a problem hiding this comment.
Following up on my earlier reviews (2026-09-15 and 2026-10-14) — all four findings are now addressed.
Resolved ✅
- Empty group ID normalization:
remaining.split("/", 2)now setsgroupId = null(not"") — confirmed inApicurioRegistryComponentand tested with a parsing test forapicurio-registry:/someArtifact. - Exchange auto-release:
createExchange(false)paired withreleaseExchange(exchange, false)in afinallyblock, covering content-fetch failures, processor failures, and normal completion. HEADER_VALIDATION_ERRORSdocumented fortestCompatibility:ApicurioRegistryConstantsnow carries@Metadata(description = "Rule violation details from validate or testCompatibility. Cleared before each check."), and the adoc explicitly says both operations set this header. TeststestTestCompatibilitySuccessandtestTestCompatibilityFailureverify it is cleared before each check and populated on failure.- Exchange release on pre-processor failure: confirmed covered in the pooled-exchange tests.
The three new commits (dc31f42, 954c450, 3aada5b) add substantial improvements: shared Vert.x with per-endpoint WebClient lifecycle, credential validation on startup, 404-retry-once logic, pagination probe, and disabled-version skipping. All well-tested.
Two minor observations on the new code
Inline comments below.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
| private final ApicurioRegistryEndpoint endpoint; | ||
| private final ApicurioRegistryConfiguration configuration; | ||
| private volatile Long lastSeenGlobalId; | ||
| private Long notFoundGlobalId; |
There was a problem hiding this comment.
Nit: notFoundGlobalId is not volatile, which is correct — ScheduledPollConsumer guarantees that poll() is called sequentially on a single scheduler thread, so there is no cross-thread visibility concern here. A brief comment would prevent future reviewers from reflexively flagging it:
// only accessed from the single poll thread managed by ScheduledPollConsumer — volatile not needed
private Long notFoundGlobalId;| @Override | ||
| protected void doStop() throws Exception { | ||
| super.doStop(); | ||
| if (ownedWebClient != null) { |
There was a problem hiding this comment.
Nit: doStop() only nulls registryClient when ownedWebClient != null. When the client was injected via setRegistryClient(), the field is intentionally left in place so a subsequent doStart() reuses it. The logic is correct, but the asymmetry can be surprising at first glance — a brief comment on the if guard would help:
// only clean up resources this endpoint owns; a caller-injected registryClient survives restart
if (ownedWebClient != null) {
registryClient = null;
closeOwnedResources();
}
davsclaus
left a comment
There was a problem hiding this comment.
Thanks @carlesarnal. The code is unchanged since my approval on e828c1e, and this head is only a rebase onto current main. Two things are needed before merge:
- Bump to 4.24. main moved to 4.24.0-SNAPSHOT, and 4.23.0 shipped without this component. The
<parent><version>incomponents/camel-apicurio-registry/pom.xml:27andtest-infra/camel-test-infra-apicurio-registry/pom.xml:25is still4.23.0-SNAPSHOT, sobuild (21, false)fails at once withNon-resolvable parent POM. Please also changefirstVersioninApicurioRegistryEndpoint.java:53to4.24.0and:since:in the adoc to4.24, then regenerate. That updates the bom entry, the catalog JSON,component.propertiesand the "Since" lines in the Endpoint DSL javadoc. - Vert.x 5. After that, CI will run against Vert.x 5.2.1 for the first time (oscerd's second point). Statically, everything
kiota-http-vertxand thecustomWebClientpath call exists in 5.2.1 with the same signatures, so I expect it to pass, but a green run is what settles it.
While you're at it: oscerd's SDK 3.3.0 → 3.3.3 question and his greedy=true note are worth a look, and the PR description still mentions 4.23. The two gnodet-bot nits only ask for code comments; adding them or replying is fine.
Reviewed with Claude Code on behalf of davsclaus. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.
Summary
JIRA: https://issues.apache.org/jira/browse/CAMEL-24172
Adds a Preview component for Apicurio Registry v3 using
io.apicurio:apicurio-registry-java-sdk:3.3.0, targeting Camel 4.23.0.URI:
apicurio-registry:groupId/artifactId[?options]The producer supports artifact/group CRUD, content and metadata retrieval, search, version listing, and validation/compatibility checks. Both checks use the registry’s dry-run API for proposed schema versions. Rule violations return error details; authentication and connection errors propagate normally.
The consumer polls for artifact versions using an in-memory global-ID watermark and sorts returned versions before delivery. Content retrieval returns byte arrays and closes response streams. Exchanges are released in a finally block, including when content retrieval or processing throws. Failed versions remain eligible for retry.
Authentication supports Basic and OAuth2/OIDC client credentials. The endpoint manages its own Vert.x resources, while supplied clients remain caller-owned.
Includes the generated catalog, BOM, documentation links, main/dependency indexes, and component/endpoint DSL factories.
Review updates
Rebased onto main at
b078bbeaf9a, resolving the parent POM conflict while retaining the newer upstream dependency version. Both module parents and first-version metadata use 4.23. SDK dependency management is centralized, credential annotations are corrected, and tests use AssertJ.The latest follow-up fixes exchange cleanup and empty group-ID parsing, documents compatibility error headers, and adds pooled-exchange failure/retry tests. The documentation also explains textual schema inputs, URI delimiters, replay behavior, and the scope of validation.
The 3.3.0 container image supports Linux amd64, arm64, ppc64le and s390x. Test infrastructure explicitly enables artifact deletion so the lifecycle tests can assert it succeeds.
Validation
../../mvnw install -Pit -qin the component module passed: 40 unit tests and 8 integration tests, with no failures or skips. Coverage includes Basic/OIDC HTTP authentication, client lifecycle, compatibility errors, pooled-exchange cleanup and retries, stream closure, header overrides, missing artifacts, and second-version polling.Formatting/import sorting and affected metadata/catalog/DSL generation completed. The full all-component build was not run; unrelated stale outputs from partial catalog generation were discarded. GitHub workflow approval requires a repository admin.
Related: Apicurio/apicurio-registry#8671
AI-assisted description prepared with OpenCode on behalf of @carlesarnal.