davsclaus opened a new pull request, #28353: URL: https://github.com/apache/camel/pull/28353
Fixes the bugs of 10 AWS components found while adding the catalog body types (CAMEL-24961): [CAMEL-26032](https://issues.apache.org/jira/browse/CAMEL-26032) aws2-ec2, [CAMEL-26070](https://issues.apache.org/jira/browse/CAMEL-26070) aws-bedrock-agent, [CAMEL-26075](https://issues.apache.org/jira/browse/CAMEL-26075) aws2-transcribe, [CAMEL-26076](https://issues.apache.org/jira/browse/CAMEL-26076) aws2-rekognition, [CAMEL-26095](https://issues.apache.org/jira/browse/CAMEL-26095) aws2-mq, [CAMEL-26096](https://issues.apache.org/jira/browse/CAMEL-26096) aws2-msk, [CAMEL-26097](https://issues.apache.org/jira/browse/CAMEL-26097) aws2-eks, [CAMEL-26098](https://issues.apache.org/jira/browse/CAMEL-26098) aws2-ecs, [CAMEL-26099](https://issues.apache.org/jira/browse/CAMEL-26099) aws-config, [CAMEL-26101](https://issues.apache.org/jira/browse/CAMEL-26101) aws2-step-functions. ## Common to all 10 With no operation option and no operation header, the producers failed with a `NullPointerException` on the `switch`. They now fail with `IllegalArgumentException: Operation must be specified, either with the operation option or the CamelAwsXxxOperation header`, as aws2-kms already did. ## Headers of the wrong type A header holding a value of another type was converted to `null` and silently left out of the request. Now it is either converted, when the conversion is unambiguous, or the exchange fails with an error that names the header: - **ec2:** `CamelAwsEC2InstanceType` also takes the AWS value (`t2.micro`, as the doc examples use) besides the constant name. `CamelAwsEC2InstancesIds` also takes ids separated by commas. - **mq:** `CamelAwsMQConfigurationID` also takes the id as a String. A `CamelAwsMQBrokerUsers` element that is not a `User` fails, instead of a `ClassCastException` in the SDK. - **msk** (`CamelAwsMSKBrokerNodesGroupInfo`) and **eks** (`CamelAwsEKSVPCConfig`): fail. - **rekognition:** `CamelAwsRekognitionFacialAttributes` and `CamelAwsRekognitionDetectionAttributes` take the attribute names as Strings, which gave a `ClassCastException` before. - **step-functions:** `CamelAwsStepFunctionsExecutionInput` must be JSON text (a String, a byte array or a stream). A `Map` was sent as `{a=1}`. ## Per component - **ecs, eks:** with pojoRequest, an empty body was reported as "but was null". eks: the `CamelAwsEKSDescription` header, which no operation read, is removed. - **msk, mq:** - With pojoRequest, create and describe now set the result headers (ARN, state, broker id). - Trace logs named the wrong command. - mq is now in the `management` category, as msk is. - Descriptions and doc examples: msk's deleteCluster example set the createCluster headers. - **ec2:** two unit tests wrapped `template.send` in `assertDoesNotThrow`, which can never fail. They now check the exchange. - **aws-config:** putConformancePack without a name said "Rule Name must be specified". The page described AWS ECS; it now describes AWS Config and its operations. - **step-functions:** - With `uriEndpointOverride`, host prefix injection is disabled. The SDK otherwise sends startSyncExecution to `sync-localhost` (emulators). - startSyncExecution sets the `CamelAwsStepFunctionsExecutionStatus` header, and `CamelAwsStepFunctionsExecutionError` and `CamelAwsStepFunctionsExecutionCause` when the execution failed. The exchange still does not fail. - **transcribe:** - createVocabulary sent a List of phrases as one phrase. It now sends one per element, plus `CamelAwsTranscribeVocabularyFileUri`; updateVocabulary sends them too. - deleteVocabulary and deleteTranscriptionJob set the response as the body. - The component refused endpoints with `useDefaultCredentialsProvider` or `useProfileCredentialsProvider`. - **rekognition:** - The javaType was `List<oftware...Attribute>`. - The operation option and `CamelAwsRekognitionClientRequestToken` had the descriptions of other components. - The page now says where the image comes from (an SDK `Image` in the headers), and the createCollection example sets the collection id. - The compareFaces tests sent the wrong image header. - **bedrock-agent:** - The endpoint used `headersClass = BedrockAgentRuntimeConstants.class`. So the catalog, the page and the endpoint DSL listed the 26 headers of aws-bedrock-agent-runtime and none of its own; they now list its 6. - The knowledge base, data source and ingestion job id headers now override the options, as in the other AWS components. Before, a header was used only when the option was empty. - The page described aws-bedrock-agent-runtime. It now describes the ingestion job operations and the consumer. ## Upgrade guide One entry in 4.24, "camel-aws - producers without an operation, and headers of the wrong type". It covers: - the new errors - the bedrock-agent headers in the catalog and endpoint DSL, and the headers now winning over the options - the removed eks header - the mq category - the transcribe changes - the step-functions input and status headers ## Not changed startSyncExecution does not fail the exchange when the execution failed (the status header is set instead). ## Tests New unit tests for each fix. All pass: ecs 25, eks 25, msk 31, mq 41, ec2 62, aws-config 10, step-functions 66, transcribe 53, rekognition 86, bedrock 147. The catalog JSON and docs, the endpoint DSL and the component DSL are regenerated. _Claude Code on behalf of davsclaus_ 🤖 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]
