davsclaus opened a new pull request, #28411:
URL: https://github.com/apache/camel/pull/28411
_Claude Code on behalf of davsclaus_
This group adds the catalog body types (CAMEL-24961) for ten IoT components:
coap, coaps, coap+tcp and coaps+tcp, milo-browse, milo-client and milo-server,
plc4x, tahu-edge and tahu-host. Each change is an `@BodyTypes` annotation on
the Endpoint, plus the JSON it generates and the catalog copy. The four coap
schemes share one Endpoint class, so they get the same body types. No doc page
changes.
**What the catalog says now**
| Component | Consumer | Reply | Producer input | Producer output |
|---|---|---|---|---|
| coap (all four) | the payload of the request as `byte[]`, empty when there
is none; also the notifications of observe | text, bytes, a stream, a file or
no body | text, bytes, a stream, a file; no body sends a GET, a body a POST,
unless CamelCoapMethod is set | the payload of the response as `byte[]`; a
`Boolean` for PING; unchanged with notify=true |
| milo-browse | | | `any`: the nodes come from the CamelMiloNodeIds header
or the node option | a Map of `ExpandedNodeId` to `BrowseResult` |
| milo-client | a `DataValue`, whose status code tells a good value from a
lost connection | | an OPC UA built-in value, a `Variant` or a `DataValue` |
unchanged; with defaultAwaitWrites, the `StatusCode` of a write, the result of
a method call, or a List of `DataValue` for a read |
| milo-server | the `DataValue` a client wrote | | an OPC UA built-in value
| unchanged |
| plc4x | a Map of tag names to their values | | a Map of tag names to a Map
of {address: value} | the `PlcWriteResponse` |
| tahu-edge | | | a `SparkplugBPayload`, or no body for the metrics of the
CamelTahuMetric headers | unchanged |
| tahu-host | the body of the payload as `byte[]`, or null; the metrics are
headers | | | |
**Checked at runtime.** Throwaway tests, not part of the PR, sent text,
bytes, a stream, a file, a Map, a POJO, a number and no body. The setups:
- **coap:** an embedded Californium server and client, over UDP and TCP.
- **milo:** the embedded Milo OPC UA server.
- **plc4x:** the `simulated://` driver, as a consumer, a triggered consumer,
a polling consumer and a producer.
- **tahu:** end to end, an edge node and a host on the HiveMQ container of
test-infra.
Not run: coaps and coaps+tcp (DTLS and TLS), the milo method call (its test
covers it), and a tahu payload with a uuid.
PRs #28367, #28368, #28371 (camel-milo) and #28387 (camel-plc4x) change code
of these modules, but not their Endpoint classes or generated files. #28387
keeps the bodies the same.
**Bugs found, not fixed here.** The JIRAs, one per component, will follow.
- **coap:**
- A POST or PUT of a body without a `byte[]` converter, such as a Map, a
POJO or an Integer, sends an empty payload with no error.
- A reply of a Map, a POJO or a number answers 2.05 with an empty payload,
and a List answers 5.00. The page says a body that cannot be converted gives
5.00.
- **milo-client:**
- One write with a body that cannot be encoded drops the shared
connection, so every subscription on it gets a Bad_NoCommunication value before
it resubscribes.
- A read without await sets the body from a Milo thread, after the
exchange has moved on.
- The write of a null body with await gives a Bad_TypeMismatch status, but
no exception.
- **milo-server:** a body that is not an OPC UA built-in type is stored with
no error, but clients cannot read it.
- **plc4x:**
- A Map value that is not a Map fails with a raw ClassCastException.
- From the code: a value with several addresses writes only the first.
- A tag that is not found fails out of the polling consumer's `receive()`,
instead of failing the exchange.
- A trigger in parentheses fails at startup, and the trigger syntax is not
documented.
- **tahu-host:**
- When a message has metrics, the consumer replaces all headers with them,
so the message type, the edge node descriptor, the timestamp, the sequence and
the UUID headers are lost.
- Each message gives two identical exchanges, from the specific callback
and from the generic one.
- **tahu-edge:** the body of the payload can never be set from the message
body; a text or bytes body fails.
**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]