davsclaus opened a new pull request, #28457: URL: https://github.com/apache/camel/pull/28457
Design document for [CAMEL-25334](https://issues.apache.org/jira/browse/CAMEL-25334), before any code, like the other documents in `design/`. ## What it proposes A new opt-in **payload mode**: with `payloadMode=json`, the body inside the route is JSON data (`JsonObject` / `JsonArray` from camel-util-json), whatever the component or the step before gave. At the edges it's the JSON text. - **Why:** low-code users, and AI models writing routes, think of the payload as JSON. Today they hit a GenericFile, a byte[], a stream or a Map instead, and their Groovy and simple mappings fail. - **The switch:** `payloadMode` on the CamelContext and per route, like stream caching. The values are `default` (today's behaviour) and `json`. - **What works without changing the languages or the EIPs:** Groovy `body.sku`, simple `${body.sku}` / `${body[sku]}`, and split and aggregate. - **Edges:** - a fallback type converter gives producers the text; - sql named parameters and mongodb use the data; - JMS/SJMS send a TextMessage instead of a MapMessage; - header values become JSON text before a remote producer. - **Display:** logs, tracing, Camel TUI and the MCP tools show the JSON text. - **An SPI (`PayloadMode`), with JSON as the first plugin.** CSV, XML and binary formats (CBOR, Avro, Protobuf) are worked through on paper, so the interface fits text and binary formats. The document also covers what changes for route authors, the alternatives considered, compatibility, risks, open questions and the order of work. AGENTS.md lists the new document with the other design documents. Documentation only, no code. _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]
