Claus Ibsen created CAMEL-27154:
-----------------------------------
Summary: camel-yaml-dsl-validator - a field read on a body of
bytes is reported, as on a body of text
Key: CAMEL-27154
URL: https://issues.apache.org/jira/browse/CAMEL-27154
Project: Camel
Issue Type: Improvement
Components: camel-yaml-dsl
Reporter: Claus Ibsen
Assignee: Claus Ibsen
Fix For: 4.24.0
The YAML DSL validator follows the body through the steps of a route
(CAMEL-24844), and reports a field read on a body that is not parsed yet, such
as ${body.qty} or a Groovy body.lines on text: the read fails at runtime. What
a running integration saw at an endpoint fills in what the catalog does not
know (CAMEL-25750).
The validator treats bytes as text. So a read of a name that text has is let
through on bytes too: lines, trim, blank and others. A byte[] has none of them.
In the local-model benchmark (connect-service-jms-request-reply step 3, r32 to
r35), the stock service gets the order as a byte[] from JMS: the route before
sends the file it read, and JMS sends a file as a BytesMessage. The model wrote
a Groovy expression that reads body.lines, and the route failed with "No such
property: lines for class: [B". The running app had seen the byte[] at
jms:queue:stock, but lines is a property of text, so the validator said
nothing. This was the failure in 8 of 21 runs of that step.
Proposal: the validator knows when the body is bytes: what the running app saw
(byte[]), or a consumer the catalog says gives only bytes. On bytes, only
length and class can be read without parsing, and the message says that the
body is still bytes: "..., but the body here is still bytes (a byte[]), not
parsed data - in the running app, from: jms:queue:stock gave a byte[]:
unmarshal it first ...".
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)