Claus Ibsen created CAMEL-25516:
-----------------------------------
Summary: camel-jbang - the validator reports a header read where
the route sets an exchange property of that name, and the reverse
Key: CAMEL-25516
URL: https://issues.apache.org/jira/browse/CAMEL-25516
Project: Camel
Issue Type: Improvement
Components: camel-jbang
Reporter: Claus Ibsen
Fix For: 4.23.0
A route that keeps a value in an exchange property and reads it as a header (or
the reverse) gets null, with no error: in the local-model benchmark's
http-client example the model kept the line's sku in the exchange property sku
and built the URL with toD http://localhost:8080/stock/${header.sku}, so every
call went to /stock/ (63 and 81 failed requests in two runs). The validator
already says this for Camel's own names ("CamelTimerCounter is an exchange
property set by timer, not a header"); the same mix-up with the route's own
names is the most common slip of a model on the HTTP examples (CAMEL-24886).
Report, at the line that reads it:
* ${header.X} (or ${headers.X}, ${header[X]}) when the route sets an exchange
property X and no step sets a header X: "the route keeps sku in an exchange
property, not a header (the header is null here): write ${exchangeProperty.sku}"
* ${exchangeProperty.X} when the route sets a header X and no exchange property
X, the other way round
Quiet where the name can come from elsewhere: a route that consumes from an
endpoint that can carry headers (only timer, scheduler, cron, quartz and file
cannot), a rest or platform-http path parameter {X}, and a name set in both
forms.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)