[backport camel-4.18.x] CAMEL-24341: camel-google-secret-manager - fix GCP vault refresh task defects - #25339
Merged
Conversation
… defects (apache#25326) * CAMEL-24341: camel-google-secret-manager - fix GCP vault refresh task defects The GCP secret refresh task read the AWS vault configuration, so camel.vault.gcp.secrets was never honoured. It also kept triggerReloading as receiver state, so every message following a matching secret event triggered another CamelContext reload, restarted the subscriber on every period (a Google ApiService can only be started while it is NEW), and dereferenced the secretId/eventType attributes without a null check, so a message published on the subscription by anything else failed and was redelivered forever. Also aligns the javadoc of the task and of the properties function with GCP and reuses a single ObjectMapper for secret sub-key lookups. Signed-off-by: Andrea Cosentino <ancosen@gmail.com> * CAMEL-24341: address review - AssertJ and package-private test conventions Per davsclaus's non-blocking note, PubsubReloadTriggerTaskTest now uses package-private class/@test visibility and AssertJ assertions (assertThat, assertThatThrownBy, assertThatCode(...).doesNotThrowAnyException()). The interface-override methods (onReload/ack/nack) stay public since they override public API. Adds a test-scoped assertj-core dependency, not previously on the module's test classpath. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Andrea Cosentino <ancosen@gmail.com> --------- Signed-off-by: Andrea Cosentino <ancosen@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
gnodet
approved these changes
Aug 5, 2026
gnodet
left a comment
Contributor
There was a problem hiding this comment.
Clean cherry-pick backport to camel-4.18.x of an already-reviewed and merged fix (PR #25326). The source-level diffs are identical to the main branch fix; the only adaptation is the expected pom.xml dependency name (camel-test-junit5 on 4.18.x vs camel-test-junit6 on main).
The original fix correctly addresses four real defects in the GCP vault refresh task:
- Reading AWS vault config instead of GCP (
aws().getSecrets()→gcp().getSecrets()) triggerReloadingas sticky instance state causing every subsequent message to trigger reload- Restarting a Google
ApiServiceon every periodic tick (throwsIllegalStateException) - NPE on messages without
secretId/eventTypeattributes
All four fixes are well-tested. The static ObjectMapper optimization is safe — readTree() is thread-safe. No API surface changes, safe for the maintenance branch. CI green.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of @gnodet
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.
Backport of #25326 (CAMEL-24341).
The GCP vault refresh task (
PubsubReloadTriggerTask) read the AWS vault configuration (getVaultConfiguration().aws().getSecrets()) instead of the GCP one, so a GCP secret-refresh subscription watched the wrong secret list. This branch has the same defect. Cherry-picked cleanly (pom auto-merged);PubsubReloadTriggerTaskTest— 4 tests pass.Claude Code on behalf of Andrea Cosentino (@oscerd).
🤖 Generated with Claude Code