oscerd opened a new pull request, #25326:
URL: https://github.com/apache/camel/pull/25326

   Fixes the defects found in `PubsubReloadTriggerTask` (the 
`gcp-secret-refresh` period task):
   
   - **The GCP task read the AWS vault configuration.** `secrets` was populated 
from
     `getVaultConfiguration().aws().getSecrets()`, so the documented 
`camel.vault.gcp.secrets` option was
     never honoured, and configuring only the GCP property made `doStart` fail 
with
     "Secrets must be configured on GCP vault configuration". The vault lookup 
now reads the GCP
     configuration, and was moved ahead of the properties-function 
auto-detection (both are plain reads,
     the "secrets must be configured" check still runs after both).
   - **`triggerReloading` was receiver state and never reset.** After the first 
matching secret event every
     subsequent message on the subscription triggered another `CamelContext` 
reload. It is now a local
     variable, like in the AWS equivalent (`CloudTrailReloadTriggerTask`).
   - **The subscriber was started on every period.** `run()` is invoked every 
`camel.vault.gcp.refreshPeriod`
     (default 30s) and a Google `ApiService` can only be started while it is 
`NEW`, so every tick after the
     first failed with an `IllegalStateException`. The subscriber is now 
started once.
   - **Foreign messages killed the receiver.** `eventType`/`secretId` were 
dereferenced without a null check,
     so any message on the subscription without those attributes threw and was 
redelivered indefinitely.
   
   Also in this PR: the javadoc of `setReloadEnabled` said "on AWS secret 
updated", the properties function
   javadoc documented `camel.vault.aws.*` instead of `camel.vault.gcp.*`, and 
the secret sub-key lookup
   allocated an `ObjectMapper` per call.
   
   `PubsubReloadTriggerTask` had no test coverage at all; this adds 
`PubsubReloadTriggerTaskTest`, with one
   test per defect above.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to