Repository navigation
[backport camel-4.22.x] CAMEL-25889: camel-google-mail/drive/calendar/sheets - create the API client per endpoint credentials instead of one per component - #28439
Conversation
… client per endpoint credentials instead of one per component (apache#28217) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> (cherry picked from commit 7203584) Signed-off-by: Andrea Cosentino <ancosen@gmail.com> # Conflicts: # docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
gnodet-bot
left a comment
There was a problem hiding this comment.
LGTM. No issues found.
The DCL pattern (volatile field + ReentrantLock) is textbook correct. Test assertion ordering is sound — afterConfigureProperties() eagerly calls getClient() during endpoint setup, so factory.created is populated before the assertions. The GoogleMailStream behavioral change (null → IllegalArgumentException on missing credentials) is a strict improvement: fail-fast with a clear message beats NPE at poll time.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 13 tested, 28 compile-only — current: 12 all testedMaveniverse Scalpel detected 41 affected modules (current approach: 12).
|
Backport of #28217
Cherry-pick of #28217 onto
camel-4.22.x.Original PR: #28217 - CAMEL-25889: camel-google-mail/drive/calendar/sheets - create the API client per endpoint credentials instead of one per component
Original author: @oscerd
Target branch:
camel-4.22.x(4.22.3)Straight cherry-pick of the squash commit 7203584: the only conflict was the 4.24 upgrade-guide file, which does not exist on this branch and was dropped (the 4.22.3 note goes to the guide on
mainin a separate PR). The remaining diff is identical to the original PR.Original description
The
google-mail,google-mail-stream,google-drive,google-calendar,google-calendar-stream,google-sheetsandgoogle-sheets-streamcomponents kept a single API client per component, created from the configuration of the first endpoint that asked for one and returned to every later endpoint of the component. Each endpoint now creates its own client from its own options on first use and keeps it for its lifetime;GoogleMailComponentkeeps one client for its own configuration for theupdate-message-labelstransformer;google-drivehonours the endpoint-levelclientFactory;google-mail-streamthrows instead of returning a null client when no credentials are set. Tests with recording fake client factories per component.Claude Code on behalf of oscerd
🤖 Generated with Claude Code