davsclaus opened a new pull request, #29576:
URL: https://github.com/apache/camel/pull/29576

   [CAMEL-26820](https://issues.apache.org/jira/browse/CAMEL-26820): more for 
what to try (`camel cmd chaos-suggest`, `ChaosManager.suggest()`, the TUI). It 
follows up #29573 (CAMEL-26817) and comes from trying the let there be chaos 
start dialog of the Camel TUI on the bundled examples.
   
   - **A circuit breaker around a call to another route** (`direct:supplier` 
inside `circuitBreaker`). The called route stands for the service. It gets two 
suggestions, both expecting the caller not to fail because the fallback answers:
     - The route is down for a while (`outage`, `rate=burst:10s/1m`), so the 
breaker opens.
     - Half of the calls fail (`rate=0.5`), past the failure rate of the 
breaker.
   
     Before this, the bundled circuit-breaker example had nothing to try.
   - **The HTTP calls of `toD`.** The rule matches the address up to the first 
expression: `http://localhost:8080/stock/${variable.sku}` becomes 
`endpoint=http://localhost:8080/stock/*`. Each call gets a 503 suggestion (an 
outage instead when there is a circuit breaker) and a 404, since a call per 
resource can find it missing. An address that starts with an expression is left 
out. `ChaosAdvisorTest.aRuleOfToDFailsTheCall` shows the 404 rule firing on a 
`toD` with `throwExceptionOnFailure=false`.
   - **Replay: a file route that moved the files it took can take them again.** 
This covers files moved to `.camel` or to a plain `move=` folder.
     - `ChaosManager.replayFiles(route)` copies them back into the route's 
folder under their own names: first under a hidden name, then with an atomic 
rename. It is also the new chaos command `replay` of the cli-connector.
     - The route moves them over the files already there, so a replay is the 
same each time. That is what an experiment that is run again needs.
     - Routes with `noop=true` (they never take a file of the same name again) 
or `delete=true` have no replay.
     - The suggestion's feed has `replay`, `files` and `replayRoute`. A route 
that a file route sends to (`inbox` → seda → `ship`) gets that file route as 
its `replayRoute`.
     - An experiment takes it as `--feed=inbox --body=replay:` 
(`ChaosExperimentRun.Feed.replay`). The files are put back after the rules are 
added, and again every second while the experiment waits, as the route takes 
them. This way a rule with a rate meets enough messages.
   
   Tried live with the TUI start dialog (it builds on this PR and comes as a 
separate PR):
   - Putting 3 files back once left `route=ship error rate=0.2` INCONCLUSIVE, 
because the rule never fired.
   - Putting them back while the experiment ran gave 234 messages in 2 minutes 
from the same 3 files: 45 faults, and FAIL with 45 messages lost at the seda 
hand-off from `inbox` to `ship`.
   - `.camel` still held exactly the 3 files.
   
   Tests: `ChaosAdvisorTest.aCircuitBreakerAroundACallToAnotherRoute`, 
`ChaosAdvisorTest.theHttpCallsOfToD`, 
`ChaosAdvisorTest.aRuleOfToDFailsTheCall`, `ChaosReplayTest` (put back, the 
`move=` folder, noop, the JSON and `replayVia`), 
`LocalCliConnectorChaosActionTest.replayPutsBackTheFilesARouteTook`, and 
`ChaosExperimentRunTest.aReplayPutsBackTheFilesTheRouteTookAfterTheRulesAreAdded`.
 All camel-chaos tests pass (857), as do the chaos tests of camel-cli-connector 
and `ChaosExperimentRunTest`.
   
   Docs: the What to try table and the feed JSON in `chaos.adoc` (and its 
catalog copy), and the file feed with `--body=replay:` in 
`camel-jbang-managing.adoc`.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_012nJsFsjqqFiwroeHRWaKbS
   


-- 
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]

Reply via email to