davsclaus opened a new pull request, #134: URL: https://github.com/apache/camel-jbang-examples/pull/134
A new example on the fail-well rung, after error handling and circuit breaker: **chaos** breaks the shop on purpose to prove that the retries, the dead letter channel and the hand-off to shipping do what they should. ## The example - `chaos.camel.yaml`: route `orders` creates an order every second, charges it with a `POST` to the payment service and hands it to route `shipping` over `seda`. A dead letter channel with two retries covers both routes. Route `payment` is the payment service (`platform-http`), so the example needs nothing else to run. - `parked.camel.yaml`: writes the orders that could not be charged or shipped to `parked/`, with an error handler of its own, as in error-handling. - `chaos/payment-outage.chaos`: a scenario with `seed=42` and three rules with an expectation each. It covers 503s for 20 s (the shop still takes 20 orders), shipping failing (no order lost on the way), then the payment service down for 10 s (no order fails). The README walks through the experiments step by step. Each one was run, and the output shown is real: 1. `camel cmd chaos-suggest`: what is worth trying. 2. A 503 to one call in four: the retries recover, a few orders are parked. 3. `route=payment stall duration=10s`: the suspended route answers 503, and the orders of those seconds are parked. 4. Shipping fails one in five, with `expect=orders->shipping:lost<=0`: met. 5. The dead letter channel fails too (`at=dlq`): the orders are lost with only a WARN, and the verdict is FAIL. 6. `camel get chaos --report`, the Camel TUI (the chaos screen, the timeline), and `t` to make a test. `camel run * --chaos=chaos/payment-outage.chaos --max-seconds=45` ends with `Chaos verdict: PASS (3 expectations met)` and exit code 0. The README's variant that adds an `at=dlq` rule ends with FAIL and exit code 1. ## Not in CI yet This example needs Camel 4.24, because camel-chaos is new in that release. CI tests with 4.23.0, so the example is not in the matrix of `build.yml`. Add it there with the move of the examples to Camel 4.24.0, and merge then. `test/chaos.citrus.it.yaml` passes locally with 4.24.0-SNAPSHOT (`camel test run`, 49 s). Also: `generate-catalog.sh` mentions chaos in the fail-well intro, and the catalog and the README tables are regenerated. `.gitignore` already ignored `parked/`; only its comment changed. `camel validate yaml --canonical` reports nothing. _Claude Code on behalf of Claus Ibsen_ -- 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]
