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

   [CAMEL-26732](https://issues.apache.org/jira/browse/CAMEL-26732)
   
   Four findings from a hands-on round. I ran an Orders demo (an HTTP call, 
seda hand-offs, a context-wide dead letter channel and a file poller) with 
`camel run --chaos`, and tried what to try (`w` / `chaos-suggest`), what has 
been tried and test with AI (`t`) by hand.
   
   **1. The shared dead letter channel was suggested once per route.**
   - Before: `errorHandler(deadLetterChannel("seda:dlq"))` gave six identical 
suggestions, `endpoint=seda:dlq error at=dlq`, one per route, including the 
route that consumes `seda:dlq`.
   - Now `ChaosAdvisor` suggests each dead letter channel once, under the first 
route that uses it, and never for the route that consumes it.
   - The suggestion carries the routes that share it (`Suggestion.routes`, 
`routes` in the JSON). The why says "routes orders, billing, audit send what 
fails …".
   - A rule of that kind in any of those routes marks it tried, both in the 
suggestion and in the report's "not tried yet".
   
   **2. The hand-off suggestion was never marked tried.**
   - The suggestion for route `orders` (kind `lost`) is `route=shipping error … 
expect=orders->shipping:lost<=0`.
   - A rule added from it fires in `shipping` and is of kind `consumer`, so 
`orders` kept "lost: not tried yet" however many times you ran it.
   - Now a rule with a lost expectation `A->B` that fired also tries `lost` for 
route A. The outcomes shown for it are those of the exchanges it faulted.
   
   **3. `camel cmd chaos-suggest` did not print the tried mark.** The 
suggestion had `tried=true` and the TUI `w` list showed it, but the CLI did 
not. It now ends the line with `- tried`, and names the routes of a shared dead 
letter channel.
   
   **4. The scenario that `t` writes did not replay the same faults.**
   - A rule draws its random choices from the seed by a key: its id when added 
while running (`r2`), and its place in a scenario (`r1` when it is the only 
rule).
   - So a scenario for rule `r2`, even with the same seed, failed other 
messages.
   - New rule option `draw=<id>`: the rule draws as the rule with that id did. 
A scenario line keeps it instead of its position key.
   - `t` now writes the rule with `draw=<its id>`, in the scenario and in 
`camel.chaos.rules` for a JUnit test. It also asks for a comment line in words, 
not the rule again: with your model, the comment just repeated the rule.
   
   **Docs:** the chaos page covers each of these: what to try, what has been 
tried, test with AI, the rule syntax block, and a paragraph on draw keys under 
"Time and the seed". The chaos model JSON is regenerated with the new option.
   
   **Tests**
   - `ChaosAdvisorDeadLetterTest` (new): one suggestion for the shared channel 
with its three routes and not the consumer, and tried by a fault in another of 
its routes.
   - `ChaosTriedTest.theHandOffSuggestionIsTriedByARuleThatExpectsNothingLost`.
   - `ChaosScenarioTest.drawReplaysARuleThatWasAddedWhileRunning`: rule `r2` 
added live with seed 42; the same rule alone in a scenario fails other 
messages, with `draw=r2` it fails the same ones; an invalid `draw=` is refused.
   - 
`CamelChaosActionTest.suggestSaysWhatWasTriedAndTheRoutesOfASharedDeadLetterChannel`.
   - `ChaosAiPromptTest`: `draw=` in both prompts, a `draw=` the rule already 
has is kept, and the worded comment.
   - Updated: `ChaosModelTest` (the list of options).
   - Local runs, all passing: camel-chaos 802, `CamelChaosActionTest` 26, TUI 
`Chaos*Test` 67.
   
   _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]

Reply via email to