feat(http-client): add CDI provider and priority-ordered factory fallback by ehsavoie · Pull Request #1071 · a2aproject/a2a-java · GitHub
Skip to content

feat(http-client): add CDI provider and priority-ordered factory fallback - #1071

Merged
kabir merged 1 commit into
a2aproject:mainfrom
ehsavoie:cdi-http-client
Aug 18, 2026
Merged

kabir merged 1 commit into
a2aproject:mainfrom
ehsavoie:cdi-http-client

Conversation

@ehsavoie

Copy link
Copy Markdown
Collaborator
  • new extras/http-client-cdi module: CdiA2AHttpClientProvider (priority 200) resolves a user-provided A2AHttpClient CDI bean via CDI.current()
  • factory iterates providers sorted by descending priority, catching exceptions and falling back to the next provider instead of failing

Fixes #135 🦕

@malladinagarjuna2

Copy link
Copy Markdown
Contributor

@ehsavoie

Copy link
Copy Markdown
Collaborator Author

…back

- extras/http-client-cdi: CdiA2AHttpClientProvider at priority 200 resolves
  a user-provided A2AHttpClient bean from CDI; falls back gracefully when no
  container is active or no unambiguous bean is found
- A2AHttpClientFactory now sorts providers at class init and iterates in order,
  catching exceptions per-provider; create(String) reuses the cached list
  instead of reloading ServiceLoader on each call
- tests use Weld SE SeContainerInitializer (no mocks) covering all four paths:
  bean present, no bean, ambiguous, no CDI container
- update A2AHttpClientProvider Javadoc with full four-tier priority table
- fix VertxA2AHttpClientProvider Javadoc and rename log field to LOGGER

Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
@kabir
kabir merged commit 24c83b0 into a2aproject:main Aug 18, 2026
15 checks passed
@ehsavoie
ehsavoie deleted the cdi-http-client branch August 26, 2026 16:05
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.

[Feat]: Make it possible to plug in other A2AHttpClient implements for the server side

3 participants