fix(httpclient): correct factory priorities and add Vert.x 5 runtime validation#7442
Merged
manusa merged 2 commits intofabric8io:mainfrom Feb 18, 2026
Merged
Conversation
VertxHttpClientFactory is now the default HTTP client but was missing the priority -1 that indicates it's the project default. OkHttpClientFactory was still using priority -1 from when it was the default. This fix: - Adds priority() returning -1 to VertxHttpClientFactory (new default) - Removes priority() override from OkHttpClientFactory (now uses default 0) This ensures deterministic factory selection when multiple HTTP clients are on the classpath - the default Vert.x client will always be preferred unless a higher priority client is present. Fixes fabric8io#7174 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
….x version compatibility Add runtime validation in Vertx5HttpClientFactory.newBuilder() to detect when Vert.x 5 classes are not available on the classpath. This provides a clear error message instead of cryptic NoClassDefFoundError when both kubernetes-httpclient-vertx (Vert.x 4) and kubernetes-httpclient-vertx-5 (Vert.x 5) are present but Maven resolves Vert.x 4 JARs. Also add detailed documentation in CHANGELOG explaining: - The mutual exclusivity of the two Vert.x HTTP client modules - How to properly configure Vert.x 5 with exclusions and property override - The root cause of the classpath conflict Fixes fabric8io#7174 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
VertxHttpClientFactory(default) now has priority -1,OkHttpClientFactoryrestored to priority 0Vertx5HttpClientFactoryto detect Vert.x version mismatch with clear error messageProblem
When Vert.x became the default HTTP client, the priority was not updated correctly:
OkHttpClientFactorystill had priority -1 (old default marker)VertxHttpClientFactoryused default priority 0This caused non-deterministic factory selection when multiple clients were on the classpath.
Additionally, when both
kubernetes-httpclient-vertxandkubernetes-httpclient-vertx-5are present, users get crypticNoClassDefFoundErrorforio.vertx.core.impl.SysProps.Solution
VertxHttpClientFactorynow returns -1 (project default),OkHttpClientFactoryuses default 0Vertx5HttpClientFactory.newBuilder()validates Vert.x 5 classes are available, providing clear error message if notTest plan
Fixes #7174
🤖 Generated with Claude Code