davsclaus commented on PR #28457:
URL: https://github.com/apache/camel/pull/28457#issuecomment-6417220897

   Two updates after a discussion:
   
   - **The strict mode is opt-in** (ea1c6609903f). Failing on invalid JSON from 
the sender is no longer always on: `payloadModeStrict`, globally 
(`camel.main.payloadModeStrict = true`) and per route, makes the consumer 
accept only payloads of the mode, so in `json` mode only valid JSON, and fails 
the message otherwise with an `InvalidPayloadException` (the hint says why). 
The check runs in the channel of the first step, so `onException` and the error 
handler handle it. A null or empty body passes. By default the mode never fails 
a message.
   - **The exchange's payload mode** (3854ce4e1db2). The route consumer marks 
the exchange with its payload mode, and copies of the exchange (`seda`, 
multicast, split, wire tap) carry it. A route without its own `payloadMode`, 
such as a utility route that several routes call with `direct`, follows the 
exchange's mode, so it acts as its caller: in `json` mode for a json route, as 
today for a route without a mode. `payloadMode=default` opts a route out. The 
mark also gives the converters at the edges the mode of the exchange, which 
helps with the open question on binary plugins (CBOR) that share the JSON data 
model.
   
   _Claude Code on behalf of davsclaus_
   


-- 
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