davsclaus opened a new pull request, #29388: URL: https://github.com/apache/camel/pull/29388
## Description [CAMEL-26718](https://issues.apache.org/jira/browse/CAMEL-26718): step 3 of the stage 2 order decided on [CAMEL-26607](https://issues.apache.org/jira/browse/CAMEL-26607). The decisions it builds on are in the [CAMEL-26607 comment](https://issues.apache.org/jira/browse/CAMEL-26607?focusedCommentId=0#comment) of 2026-11-07, under "S2-1" and "S2-2". **Stacked on #29387** (CAMEL-26717), which is stacked on #29386 (the multi-hook). Retarget this PR to `main` once those two have merged. ### `in=`: the sends and steps of a route (S2-2) ``` endpoint=http:* in=orders error status=503 step=* in=orders delay duration=500ms component=kafka in=order* drop ``` - `in=` is the route of the unit of work. It is not the routes that route calls: a send inside a route called with `direct:` belongs to that other route. A pattern (`in=order*`) takes more routes. With `at=poll`, `in=` is the route whose consumer polls. - `in=` is checked before the rate, so `rate` and an `until` count only count the matches in those routes. - It is refused with `route=` (the target is a route already), and with `stall` and `lifecycle`. - Adding a rule warns when no route matches `in=`, or when the target matches nothing inside those routes. The warning lists the sends or steps that are there. - `ChaosTargets.reach` keeps what each route reaches, so the hooks that can fire (from CAMEL-26717) only look at the routes of `in=`. - The rule in plain words says it: "fail half of the sends to http:stock* in route orders with HTTP status 503". - The chaos screen shows `in=` with the target (`http:* in orders`), not with the fault. - The chaos model has the new option, with `pick: routes`. ### Errors and delays at the route entry (S2-1) ``` route=orders error rate=0.05 route=orders error exception=java.net.ConnectException route=orders delay duration=2s ``` - The route policy decides once per exchange, as the exchange enters the route. - If the rule fires, the policy marks the exchange (`ChaosExchangeState.entryFault`). `ChaosStepHook` then fails or delays the exchange at the first step of the route, which is inside the error handler of the route. - So `onException`, redelivery and the dead letter channel apply, as for a real failure inside the route. - The mark is used once, so a redelivery of that first step runs the step itself and the exchange counts as recovered. - When the route does not handle the error, the consumer sees the failure: a JMS rollback, the file left in place, an HTTP 500. The docs say so. - A delay waits on the thread of the consumer. The docs say that too. - There is no `drop` at the entry and no `at=consumer`, as decided. ### Also in this PR - Three recipes in the chaos model: "The route fails", "The route is slow" and "The sends of the route fail". Each has a guide. - The model and the doc are regenerated, and their catalog copies are updated. - `chaos.adoc` gets a section "The sends and steps of a route" and an updated `entry` hook. The design doc's `route=` bullet is updated. - Two `in=` examples are added to the `chaos-add` help, and the CLI help golden is updated. ## Tests - camel-chaos: 744 tests, all green. - The new `ChaosInRouteTest` covers the sends of one route only, the route of the exchange rather than the routes it calls, patterns, the rate counted inside the route, steps, polls, the warnings, and the hooks that can fire. - The new `ChaosRouteEntryErrorTest` covers: - failing at the first step; - redelivery recovers; - the dead letter channel; - `onException` with a typed exception; - a route that is called; - the rate per exchange; - a delay; - `corrupt` unchanged. - Parser, describe and model cases were added. - camel-jbang-plugin-tui: the Chaos* tests and `SourceSizeTest` pass (48 tests). - camel-jbang-core: `CliHelpGoldenTest` passes. I did not check this against a running integration: that needs the core jars of #29386. _Claude Code on behalf of Claus Ibsen_ 🤖 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]
