saravanakumar1987 opened a new pull request, #31407: URL: https://github.com/apache/camel/pull/31407
# Description Fixes [CAMEL-28125](https://issues.apache.org/jira/browse/CAMEL-28125). ## Summary An empty or non-numeric text in a number header failed every oss and sls operation. The producers now read each number only for its operation, and an empty or blank text counts as not set. A value that does not convert fails with an error that names the header or the exchange property. - `OSSUtils` reads `CamelAlibabaOssMaxKeys` only for `listObjects`. - `AlibabaSlsUtils` reads `CamelAlibabaSlsFrom`, `CamelAlibabaSlsTo`, `CamelAlibabaSlsLine` and `CamelAlibabaSlsOffset` only for `getLogs`. - It reads `CamelAlibabaSlsListOffset` and `CamelAlibabaSlsSize` only for `listLogStores`. - Each reads the exchange property of the same name in the same way, as `KMSUtils` does for `CamelAlibabaKmsNumberOfBytes`. - The upgrade guide has a section on it. ### Why the message names the type The header table gives `Integer` or `Long` as the type of these headers. Camel converts a text with `Integer.valueOf` or `Long.valueOf` in `ObjectConverter`. So a text such as 1.5, or a text beyond the range of the type, fails too. Camel cannot convert a `Boolean` to these types, so it fails now, where it counted as not set before. ## Tests - `MaxKeysHeaderTest` and `NumberHeadersTest` use mocked clients, and all 11 of their tests failed before the change. - They check that other operations ignore non-numeric headers, and that an empty header falls back to the property or option. - They check that the error for a value that is no number names the header or the exchange property. - The oss module build ran 42 tests and the sls module build 21 tests, none of them skipped or failed. # Target - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch) # Tracking - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it). # Apache Camel coding standards and style - [x] I checked that each commit in the pull request has a meaningful subject line and body. - [x] I ran `mvn clean install -Dquickly -DskipTests` on the parent commit, and resumed it from camel-kserve with `-Dgrpc-version=1.85.1`. Then I ran `mvn install -nsu` in camel-alibaba-oss and camel-alibaba-sls, which changed no generated file. # AI-assisted contributions - [x] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used. _Claude Code on behalf of saravanakumar1987_ 🤖 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]
