CAMEL-23338: camel-opensearch - Add OpenSearchClient as component option - #24980
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
gnodet
left a comment
There was a problem hiding this comment.
Review: CAMEL-23338 — Add OpenSearchClient as component option
Clean feature addition following the existing client (RestClient) option pattern. The implementation is well-structured:
- Transport extraction via
_transport()is the right approach — avoids duplicating async client creation logic - Lifecycle guards are thorough —
doStart(),cleanup(), anddoStop()all properly skip when a user-providedopenSearchClientis set, preventing the component from closing resources it doesn't own - Documentation targets the real-world use case (AWS OpenSearch + IAM auth)
Suggestions
-
Tests: No new tests exercise the
openSearchClient != nullpath. A unit test verifying transport extraction and lifecycle guard behavior would add confidence — even without a running OpenSearch instance. -
disconnectinteraction: WhenopenSearchClientis set, thedisconnectendpoint option is silently skipped (correctly). A note in the docs would help users understand this.
Neither blocks the merge — the logic is straightforward and well-guarded.
LGTM ✅
Reviewed with Claude Code on behalf of gnodet. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 11 tested, 27 compile-only — current: 9 all testedMaveniverse Scalpel detected 38 affected modules (current approach: 9).
|
Summary
Claude Code on behalf of davsclaus
Adds a new
openSearchClientcomponent option tocamel-opensearch, allowing users to provide a pre-configuredOpenSearchClientinstance instead of having the component build one internally from host addresses. This is useful when a custom transport is needed, for example when connecting to AWS OpenSearch Service with IAM-based authentication viaAwsSdk2Transport.Key design points:
@Metadata(label = "advanced", autowired = true)— follows the same pattern as the existingclient(RestClient) optionRestClientandOpenSearchClientare available, theOpenSearchClienttakes precedencedoStart,process,cleanup,doStop) are properly guarded — the component never closes or manages resources it doesn't own (the user's custom client/transport)Changes:
OpensearchComponent— newopenSearchClientfield with autowiringOpensearchEndpoint— stores and exposes the clientOpensearchProducer— branches on custom client inprocess(), guards lifecycle indoStart/doStop/cleanupSupersedes: #24320 (contributor did not complete review feedback after multiple rounds)
Test plan
mvn testincomponents/camel-opensearch)🤖 Generated with Claude Code