Claus Ibsen created CAMEL-26719:
-----------------------------------
Summary: camel-chaos - when= fires a rule only for the messages
that meet a condition
Key: CAMEL-26719
URL: https://issues.apache.org/jira/browse/CAMEL-26719
Project: Camel
Issue Type: Improvement
Components: camel-jbang
Reporter: Claus Ibsen
Assignee: Claus Ibsen
Fix For: 4.24.0
Step 4 of the stage 2 order decided on CAMEL-26607 (S2-3): a condition on the
message.
* {{endpoint=http:stock* error status=503 when="${header.country} == 'ES'"}}.
The simple language only, in quotes. A {{<language>:}} prefix is reserved for
later, and refused for now. The "or" of the prompt on CAMEL-26330 stays two
rules.
* The predicate is built once, when the rule is added (the simple language of
the context), and checked in the hooks before the rate: {{matches}}, {{rate}}
and {{until=<count>}} count only the messages that meet the condition, and a
seed gives the same faults for the same matching messages.
* Not with {{at=poll}}, {{stall}} or {{lifecycle}}: there is no message.
Without {{at=}}, a rule with {{when=}} leaves out the polls of its target.
* Reading a stream body consumes it: the stream cache is reset after the check,
a stream body that is not cached yet (such as a reply) is cached first, and a
condition on the body is refused when stream caching is off.
* A predicate that throws counts as not matched, and shows in
{{skippedReasons}}; it does not fail the exchange.
* The rule in plain words says it; the chaos model gets the option; the chaos
screen keeps it out of the fault column.
_Claude Code on behalf of Claus Ibsen_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)