Skip to content

CAMEL-24961: Catalog body types for coap, milo, plc4x and tahu - #28411

Closed
davsclaus wants to merge 1 commit into
mainfrom
feature/CAMEL-24961-body-types-iot
Closed

davsclaus wants to merge 1 commit into
mainfrom
feature/CAMEL-24961-body-types-iot

Conversation

@davsclaus

@davsclaus davsclaus commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

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. Filed one JIRA per component: CAMEL-26178 (camel-coap), CAMEL-26179 (camel-milo), CAMEL-26180 (camel-plc4x), CAMEL-26181 (camel-tahu).

  • 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

@davsclaus davsclaus added this to the 4.24.0 milestone Oct 24, 2026
@davsclaus davsclaus added the enhancement New feature or request label Oct 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. No issues found.

Purely additive metadata: @BodyTypes annotations on 7 Endpoint classes and the corresponding generated JSON for 10 IoT components (coap×4, milo-browse, milo-client, milo-server, plc4x, tahu-edge, tahu-host). Descriptions accurately reflect runtime behavior — including the known silent-failure cases documented honestly in the PR body. Catalog and component-local JSON copies are consistent. No code logic changed.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • catalog/camel-catalog
  • components/camel-coap
  • components/camel-milo
  • components/camel-plc4x
  • components/camel-tahu

🔬 Scalpel shadow comparison — Scalpel: 11 of 707 tested, 26 compile-only — current: 11 all tested

Maveniverse Scalpel detected 11 affected modules (current approach: 11).

Skip-tests mode would test 11 modules (5 direct + 7 downstream), skip tests for 26 (generated code, meta-modules)

Modules Scalpel would test (11)
  • camel-coap ← components/camel-coap/src/generated/resources/META-INF/org/apache/camel/coap/coap+tcp.json, components/camel-coap/src/generated/resources/META-INF/org/apache/camel/coap/coap.json, components/camel-coap/src/generated/resources/META-INF/org/apache/camel/coap/coaps+tcp.json, components/camel-coap/src/generated/resources/META-INF/org/apache/camel/coap/coaps.json, components/camel-coap/src/main/java/org/apache/camel/coap/CoAPEndpoint.java
  • camel-jbang-mcp ← downstream of org.apache.camel:camel-catalog
  • camel-jbang-plugin-mcp ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-tui ← downstream of org.apache.camel:camel-catalog
  • camel-jbang-plugin-validate ← downstream of org.apache.camel:camel-yaml-dsl-validator
  • camel-launcher-container ← downstream of org.apache.camel:camel-launcher
  • camel-milo ← components/camel-milo/src/generated/resources/META-INF/org/apache/camel/component/milo/browse/milo-browse.json, components/camel-milo/src/generated/resources/META-INF/org/apache/camel/component/milo/client/milo-client.json, components/camel-milo/src/generated/resources/META-INF/org/apache/camel/component/milo/server/milo-server.json, components/camel-milo/src/main/java/org/apache/camel/component/milo/browse/MiloBrowseEndpoint.java, components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java, components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerEndpoint.java
  • camel-plc4x ← components/camel-plc4x/src/generated/resources/META-INF/org/apache/camel/component/plc4x/plc4x.json, components/camel-plc4x/src/main/java/org/apache/camel/component/plc4x/Plc4XEndpoint.java
  • camel-tahu ← components/camel-tahu/src/generated/resources/META-INF/org/apache/camel/component/tahu/tahu-edge.json, components/camel-tahu/src/generated/resources/META-INF/org/apache/camel/component/tahu/tahu-host.json, components/camel-tahu/src/main/java/org/apache/camel/component/tahu/TahuEdgeEndpoint.java, components/camel-tahu/src/main/java/org/apache/camel/component/tahu/TahuHostEndpoint.java
  • camel-yaml-dsl-validator ← downstream of org.apache.camel:camel-catalog
  • camel-yaml-dsl-validator-maven-plugin ← downstream of org.apache.camel:camel-yaml-dsl-validator
Modules with tests skipped (26)
  • apache-camel
  • camel-allcomponents
  • camel-catalog-console
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • components/camel-tahu: 1 test(s) disabled on GitHub Actions
All tested modules (38 modules, 5m 14s total)

Total reactor time: 5m 14s

Module Duration Status
Camel :: JBang :: Plugin :: TUI 54.7s SUCCESS
Camel :: Tahu 51.8s SUCCESS
Camel :: JBang :: Plugin :: Validate 23.5s SUCCESS
Camel :: Launcher 21.6s SUCCESS
Camel :: YAML DSL 21.4s SUCCESS
Camel :: YAML DSL :: Validator 17.4s SUCCESS
Camel :: JBang :: MCP 16.6s SUCCESS
Camel :: Catalog :: Camel Catalog 14.4s SUCCESS
Camel :: Component DSL 14.2s SUCCESS
Camel :: PLC4X 10.9s SUCCESS
Camel :: Docs 9.6s SUCCESS
Camel :: Kamelet Main 8.6s SUCCESS
Camel :: Catalog :: Camel Report Maven Plugin 8.1s SUCCESS
Camel :: JBang :: Plugin :: Kubernetes 7.5s SUCCESS
Camel :: Catalog :: Camel Route Parser 4.9s SUCCESS
Camel :: JBang :: Plugin :: Testing 4.8s SUCCESS
Camel :: YAML DSL :: Deserializers 4.4s SUCCESS
Camel :: All Components Sync point 3.3s SUCCESS
Camel :: Catalog :: Maven 2.4s SUCCESS
Camel :: YAML DSL :: Validator Maven Plugin 2.3s SUCCESS
Camel :: YAML DSL :: Maven Plugins 2.0s SUCCESS
Camel :: Catalog :: Suggest (deprecated) 1.6s SUCCESS
Camel :: Assembly 1.2s SUCCESS
Camel :: JBang :: Integration tests 1.0s SUCCESS
Camel :: JBang :: Plugin :: Generate 0.8s SUCCESS
Camel :: JBang :: Plugin :: Edit 0.8s SUCCESS
Camel :: Coverage 0.8s SUCCESS
Camel :: Catalog :: Dummy Component 0.8s SUCCESS
Camel :: Catalog :: Console 0.7s SUCCESS
Camel :: Endpoint DSL :: Support 0.6s SUCCESS
Camel :: JBang :: Main 0.5s SUCCESS
Camel :: Launcher :: Container 0.5s SUCCESS
Camel :: JBang :: Plugin :: MCP 0.4s SUCCESS
Camel :: CoAP n/a
Camel :: Endpoint DSL n/a
Camel :: Integration Tests n/a
Camel :: JBang :: Core n/a
Camel :: Milo n/a

Top 20 slowest modules:

  • Camel :: JBang :: Plugin :: TUI (54.7s)
  • Camel :: Tahu (51.8s)
  • Camel :: JBang :: Plugin :: Validate (23.5s)
  • Camel :: Launcher (21.6s)
  • Camel :: YAML DSL (21.4s)
  • Camel :: YAML DSL :: Validator (17.4s)
  • Camel :: JBang :: MCP (16.6s)
  • Camel :: Catalog :: Camel Catalog (14.4s)
  • Camel :: Component DSL (14.2s)
  • Camel :: PLC4X (10.9s)
  • Camel :: Docs (9.6s)
  • Camel :: Kamelet Main (8.6s)
  • Camel :: Catalog :: Camel Report Maven Plugin (8.1s)
  • Camel :: JBang :: Plugin :: Kubernetes (7.5s)
  • Camel :: Catalog :: Camel Route Parser (4.9s)
  • Camel :: JBang :: Plugin :: Testing (4.8s)
  • Camel :: YAML DSL :: Deserializers (4.4s)
  • Camel :: All Components Sync point (3.3s)
  • Camel :: Catalog :: Maven (2.4s)
  • Camel :: YAML DSL :: Validator Maven Plugin (2.3s)

⚙️ View full build and test results

… milo-browse, milo-client, milo-server, plc4x, tahu-edge and tahu-host

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
@davsclaus
davsclaus force-pushed the feature/CAMEL-24961-body-types-iot branch from 0367cc1 to a0862d3 Compare October 24, 2026 15:32
davsclaus added a commit that referenced this pull request Oct 24, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
@davsclaus

Copy link
Copy Markdown
Contributor Author

Merged to main as b4a4e0e (squashed with the other CAMEL-24961 body type groups, tested together locally).

Claude Code on behalf of davsclaus

@davsclaus davsclaus closed this Oct 24, 2026
@davsclaus
davsclaus deleted the feature/CAMEL-24961-body-types-iot branch October 24, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants