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

   ## What
   
   [CAMEL-26771](https://issues.apache.org/jira/browse/CAMEL-26771): `camel cmd 
chaos-suggest` says how to feed each route, so an agent (or a person) knows how 
to send the traffic a rule needs. Step 3 of 
[CAMEL-26760](https://issues.apache.org/jira/browse/CAMEL-26760) ("let there be 
chaos").
   
   Builds on #29458 (CAMEL-26765, chaos sees through stubs, merged): the hint 
tells a stub from the real system.
   
   ```
   1. route refunds: Is delivered twice (duplicate)
      the input of route refunds can deliver a message again: is the call to 
kafka://refunds-done safe to make twice?
      camel cmd chaos-add --rule='endpoint=kafka://refunds-done duplicate 
rate=0.1 until=10m'
      feed: camel cmd send spike5 --endpoint=refunds --body=<message> 
--repeat=20 --interval=200ms
   ```
   
   ## Changes
   
   - `ChaosAdvisor.feed(route)` reads the input of the route:
     - `timer`, `scheduler`, `cron`, `quartz`: the route feeds itself (no 
`feed:` line in the CLI).
     - `platform-http`, `rest`: `curl` with the method (`httpMethodRestrict`, 
or the verb of `rest:`), the path and the port of the HTTP server 
(`camel.server.port`, 8080 by default).
     - `jetty`, `netty-http`, `undertow`, `servlet`, `vertx-http`: `curl` to 
the address in the URI.
     - `file`: write a file into its folder.
     - Anything else (`direct`, `seda`, a broker, a stub of one): `camel cmd 
send <integration> --endpoint=<route id> --body=<message> --repeat=20 
--interval=200ms`. The route id as the endpoint makes the send console send to 
the input of the route with all its options, so it is the same for a stub and a 
real broker. `--repeat`/`--interval` come from #29459 (CAMEL-26767).
     - `real`: the input is a remote endpoint that is not a stub, so the 
messages go to the real system. The CLI then says "run with --stub=remote to 
feed a stub instead".
   - `ChaosManager.suggest()` adds `feed` (`kind`, `hint`, `real`) to each 
suggestion, computed once per route.
   - The CLI prints the `feed:` line, and the footer of `chaos-suggest` 
mentions it. The AI (`chaos_suggest`) and MCP (`camel_runtime_chaos_suggest`) 
descriptions say what `feed` holds.
   - Docs: a table of how each input is fed in "What to try", and `feed` in the 
JSON; catalog copy and golden help regenerated.
   - Not changed: the TUI suggestion list (key `w`). That comes with the TUI 
explore step.
   
   ## Tests
   
   - `ChaosFeedTest` (new): timer, direct, file, a stub of a remote component 
(fed with send, not real), a remote input that is not a stub (real); the JSON 
of the suggestions; the method and path of `platform-http` and `rest` inputs.
   - `CamelChaosActionTest.suggestSaysHowToFeedTheRoute`: the `feed:` line, the 
note for a real system, and no line for a route that feeds itself.
   - Local runs, all passing: camel-chaos (810), camel-jbang-core 
`CamelChaos*Test` + `CliHelpGoldenTest` + `ToolRegistry*Test`, camel-jbang-mcp 
(542).
   - End to end with `camel run --stub=remote --chaos`: the output above, and 
no `feed:` for the timer route.
   
   _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