davsclaus opened a new pull request, #29557: URL: https://github.com/apache/camel/pull/29557
[CAMEL-26804](https://issues.apache.org/jira/browse/CAMEL-26804) is the first step of feeding chaos experiments from test-infra services (CAMEL-26760). Since CAMEL-26792, a chaos experiment warns when its feed goes to a remote system that is not stubbed, because the messages reach that system, and suggests `camel infra run kafka` instead. When the route's broker *is* the one `camel infra run` started on this machine, that warning is wrong. Now: - The new `InfraServices` reads the running `camel infra` services from their pid files (`~/.camel/infra-<service>-<pid>.json`). It skips a pid whose process is gone, and collects the ports in each service's data: the `port` fields, and the port of every `host:port`, such as `brokers` or `tcp://127.0.0.1:61616`. - `ChaosExperimentRun.localInfra` takes the addresses of the route's input from the status. These are the `services` the integration reports (the `serviceUrl` of `EndpointServiceLocation`, such as the Kafka brokers, which are often configured on the component rather than in the URI), plus the URI it starts from. If all of them are on this machine, on ports of one infra service, there is no warning, and the traffic says so. - An address on another host or port, a list where only some brokers are local, or no address at all still gets the warning, as before. Tried live with `camel infra run kafka` and the chaos example (camel-jbang-examples#134), with refunds on the real Kafka and not stubbed: ``` Experiment 1 FAIL (r1, ended after 3s) expect refunds:failed<=0: unmet, 2 failed traffic: 6 messages sent to kafka://refunds?brokers=localhost:9092&groupId=shop (the local kafka from camel infra) in 199ms ``` Tests: - `InfraServicesTest`: reading pid files (a dead pid is skipped, ports come from fields and from addresses), and matching addresses. - `ChaosExperimentRunTest`: no warning for the infra broker, and the warning stays for another port or when nothing runs. Docs: `camel-jbang-managing.adoc`, and one line in the exploration playbook. _Claude Code on behalf of Claus Ibsen_ 🤖 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]
