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

   ## Summary
   
   Wire up two `ConsulClusterService` options that were silently ignored:
   
   - **`blockSeconds`** — the wait time (in seconds) of the blocking query that 
watches the lock key in the Consul KV store
   - **`datacenter`** — the Consul datacenter to route the query to
   
   Both options were accepted by `ConsulClusterService`, copied into 
`ConsulClusterConfiguration` during `doInit()`, but never actually used by 
`ConsulClusterView` when making the blocking watch query.
   
   ## Root Cause
   
   `ConsulClusterView.watch()` built its `QueryOptions` using 
`configuration.getSessionRefreshInterval()` instead of 
`configuration.getBlockSeconds()`, and never called `.datacenter(...)` on the 
builder at all. The `@Metadata` annotations for both fields already admitted 
they were "Not used".
   
   ## Fix
   
   - In `ConsulClusterView.watch()`, replace 
`configuration.getSessionRefreshInterval()` with 
`configuration.getBlockSeconds()` as the blocking query wait time.
   - Conditionally add `.datacenter(configuration.getDatacenter())` to the 
`QueryOptions` builder when the datacenter is set.
   - Update the `@Metadata` descriptions on both fields to remove the "Not 
used" language.
   - Update the generated `ConsulClusterService.json` to match.
   
   ## Tests
   
   Added `usesBlockSecondsAndDatacenterInQueryOptions` to 
`ConsulClusterViewRecoveryTest`. It starts a service with `blockSeconds=42` and 
`datacenter=dc2`, captures the `QueryOptions` passed to the first blocking 
watch via Mockito `ArgumentCaptor`, and asserts that:
   - the wait parameter starts with `"42"` (i.e. `"42s"`)
   - the datacenter is `"dc2"`
   
   All 12 tests in `ConsulClusterViewRecoveryTest` pass.
   
   Fixes CAMEL-28006
   
   ---
   _Hermes Agent (Claude Sonnet 4.6) on behalf of Guillaume Nodet_
   


-- 
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