oscerd opened a new pull request, #31261: URL: https://github.com/apache/camel/pull/31261
## Changes **1. `putMetricData` enforces the 1000 `MetricDatum` limit.** A collection or array body was passed straight through, so a larger body failed the whole exchange with an opaque AWS error after a full round trip. It now fails locally with a message giving the size, in the style CAMEL-27307 established for the empty-body case. **2. The `CamelAwsCwMetricDimensions` header is converted, not cast.** The header was read as a raw `Map` and its entries cast to `String`, so a `Map<String, Integer>` — easy to build with a Simple expression — threw a bare `ClassCastException` from inside the producer. A shared `determineDimensions` helper now converts keys and values through the type converter and fails with a message naming the header. This replaces three copies of the same loop (`listMetrics`, `describeAlarmsForMetric`, `setDimension`). **3. Documentation.** The page documented none of `listMetrics`, `describeAlarms` and `describeAlarmsForMetric`. Added an Operations section, plus the batch limit and the dimensions conversion. Catalog doc copy synced. ## Withdrawn from the ticket CAMEL-28029 item 1 claimed the client is created in `doInit` but closed in `doStop`, so a restarted endpoint would hold a closed client. **That is wrong and is not fixed here** — `BaseService.init()` guards with `status <= BUILT || status >= STOPPED` and the comment *"allow to initialize again if stopped or failed"*, so `doInit` runs again after a stop and the client is recreated. A test written against unmodified code passes. I've commented the correction on the ticket. Two tests from that investigation are kept as regression guards for the client lifecycle, since they pin behaviour nothing covered before: a restarted endpoint ends up with a usable client, and a user-supplied client is neither closed nor replaced. ## Not in this PR - the boxed `Boolean` credentials setter — covered family-wide by CAMEL-28051 - `getMetricData`/`getMetricStatistics` and alarm management — enhancements, not defects ## Testing `mvn test` in `components/camel-aws/camel-aws2-cw`: 33 tests, all passing. Both behaviour fixes were verified to fail against unmodified code (the dimensions one with a `ClassCastException`, exactly as reported). _Claude Code on behalf of oscerd_ 🤖 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]
