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

   _Claude Code on behalf of davsclaus_
   
   This group adds the catalog body types (CAMEL-24961) for the eight alibaba 
components (alibaba-eventbridge, -fc, -kms, -mns, -oss, -ots, -sls and -sms), 
dapr and consul. Each change is an `@BodyTypes` annotation on the Endpoint, 
plus the JSON it generates and the catalog copy. Three doc pages had their body 
text corrected.
   
   **What the catalog says now**
   
   | Component | Consumer | Producer input | Producer output |
   |---|---|---|---|
   | alibaba-eventbridge | | JSON text of the event data, a Map of event 
fields, a `CloudEvent`, or a List of them | a Map with the request id and the 
failed entries |
   | alibaba-fc | | text, bytes, a stream, a file or no body for invokeFunction 
| a Map with the status code, the headers and the payload (`byte[]`) |
   | alibaba-kms | | the plaintext for encrypt, the ciphertext for decrypt (the 
options and headers win) | a Map of the response |
   | alibaba-mns | the message as text | text, bytes, a stream or a file | 
unchanged; the message id is an exchange property |
   | alibaba-oss | the content of the object as `byte[]` | text, bytes, a 
stream or a file for putObject | a Map; `byte[]` for getObject; a List of Maps 
for the lists |
   | alibaba-ots | | the Tablestore `*RowRequest` of the row operation | a Map; 
a List of names for listTables |
   | alibaba-sls | | a `LogGroup` or a `PutLogsRequest` for putLogs | a Map |
   | alibaba-sms | | `any`: the body is not read | a Map |
   | dapr | `byte[]` for pubSub, a Map for configuration | the body as is: 
bytes raw, anything else as JSON (text becomes a JSON string); a stream fails | 
by operation: `byte[]` or null for invokeService and invokeBinding, the State 
objects, a Map for secret and configuration, a `Boolean` for lock |
   | consul | the value as base64 text for kv (decoded with valueAsString), the 
payload of an event as text | the value as text for PUT, LOCK and FIRE; a POJO 
for REGISTER and CREATE | by action: the `Value` (or a String with 
valueAsString), Lists and Maps of the client, an `Optional` for some session 
and query actions; unchanged for the writes, with the result in 
CamelConsulResult |
   
   **Checked at runtime.** Throwaway tests, not part of the PR, sent text, 
bytes, a stream, a file, a Map, a POJO and no body. The setups:
   - **alibaba:** Mockito clients set on the endpoint, with dummy keys and no 
credentials of the host.
   - **dapr:** mocked `DaprClient`, `DaprPreviewClient` and 
`DaprWorkflowClient`, behind the real producers and consumers.
   - **consul:** a consul 2.0.4 container of test-infra.
   
   Every call stayed local.
   
   Not run:
   - the real Alibaba services and the real Dapr sidecar;
   - consul GET_NODE, RENEW, INFO and the preparedQuery CREATE and EXECUTE 
actions, which were read from the client signatures.
   
   **Choices**
   - fc, kms, ots, sls and sms have no default operation, so their default 
input is `any` with byOption for the operations that read the body, as 
aws2-lambda does.
   - dapr uses byOption on `operation` only. The sub-operation options have 
defaults that would wrongly apply to the other operations.
   
   **Doc fixes**
   - **alibaba-eventbridge:** the platform-http example sent the request 
stream, which the producer does not read, and answered the HTTP request with 
the Map of the result. It now converts the request to a String and marshals the 
result to JSON. The YAML validator of the check reported it.
   - **alibaba-oss:** getObject gives the content as `byte[]`, not a Map.
   - **alibaba-sls:** putLogs needs a `LogGroup` or a `PutLogsRequest`. The 
examples still set a text body, which fails.
   - **consul:** GET_VALUE gives the `Value` of the client, which holds the 
value base64 encoded, and the kv consumer gives base64 text unless 
valueAsString is set.
   
   **Bugs found, not fixed here.** The JIRAs, one per component, will follow.
   - **dapr:**
     - `dapr:secret` always fails with "No handler for operation secret", 
because `DaprOperationManager` never registers `DaprSecretHandler`. The unit 
tests call the handler directly.
     - The producer replaces all the headers of the message with the headers of 
the response.
     - A stream body fails in the JSON serializer, as it is not turned into 
bytes first.
     - A text body is sent as a quoted JSON string.
   - **consul:**
     - FIRE with no body fails with a NullPointerException.
     - The base64 default of the kv consumer and GET_VALUE was not documented.
     - GET_SESSIONS, RENEW and preparedQuery GET put an `Optional` in the body, 
while INFO unwraps it.
     - The agent and status actions never set CamelConsulResult.
   - **alibaba-fc, alibaba-kms, alibaba-mns:** a stream or a file is read as 
text, so a binary payload is corrupted (`ff` becomes `ef bf bd`), while a 
`byte[]` is kept. mns does this to a `byte[]` too, though the SDK takes bytes.
   - **alibaba-mns:**
     - operation=receiveMessage is documented, but the producer fails with 
UnsupportedOperationException, and the consumer ignores the option.
     - The message id and MD5 constants are labelled as headers, but they are 
set as exchange properties.
   - **alibaba-eventbridge:** bytes or a stream, as an HTTP or Kafka consumer 
gives them, fail instead of being read as text.
   - **alibaba-oss:** the consumer reads each object fully into memory.
   
   **Local checks**
   - The changed modules build, with no change to the generated files after the 
build.
   - The catalog copies equal their modules.
   - camel-catalog, camel-yaml-dsl-validator and camel-jbang-core tests pass.
   - The Endpoint and Component DSLs regenerate with no change.
   
   🤖 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