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

   [CAMEL-26479](https://issues.apache.org/jira/browse/CAMEL-26479)
   
   `camel run --chaos` now works with `--runtime=spring-boot`. Quarkus is still 
refused, with a clearer message.
   
   **Spring Boot**
   - The exported project gets plain `camel-chaos`. No starter is needed: 
`ChaosContextServicePlugin` is a `ContextServicePlugin`, found on the classpath 
by any `CamelContext`.
   - A Spring Boot application has no Camel profile `dev`, so the run adds 
`-Dcamel.chaos.enabled=true` to `spring-boot.run.jvmArguments`, unless the 
profile is `prod`. With `prod` it prints the same "camel-chaos stays off with 
profile prod" warning as the other runtimes.
   - `--chaos=<file>` and `--chaos-report` go into the same JVM arguments. A 
path with a space is quoted, since the plugin parses that string as a command 
line.
   - All of this is on the command line of the run. Nothing is written into the 
exported `application.properties`, so a project from `camel export` never has 
chaos switched on.
   - An existing Spring Boot project (`camel run pom.xml`) gets `camel-chaos` 
in its temporary run pom. It uses the version the project imports 
`camel-spring-boot-bom` with, which can be a property, because that BOM only 
manages the starters.
   
   **Quarkus**
   Still refused. `camel-chaos` is new in Camel 4.24, and the latest Camel 
Quarkus (3.40.0) is on an older Camel. The export would pair `camel-chaos` 4.24 
with an older `camel-core`. Once Camel Quarkus is on 4.24, JVM mode can do the 
same as Spring Boot. Native mode needs a `camel-quarkus-chaos` extension.
   
   **Docs**
   - The chaos page, `design/chaos.adoc` and the running page are updated.
   - They also used to say that only camel-main checks the `insecure:dev` chaos 
options against the security policy. Camel Spring Boot checks them too: 
`CamelSecurityPolicyAutoConfiguration` allows them with profile `dev`, warns 
without a profile, and fails with `prod`. The docs now say so.
   
   **Tests**
   - `ProjectRunnerTest` (15, 4 new):
     - a Spring Boot run with chaos: the dependency, the JVM arguments with a 
quoted path, and nothing in the exported properties;
     - the same run with profile `prod`: chaos stays off;
     - an existing Spring Boot project: the version follows the imported BOM;
     - the fallback Camel version.
   - `CommandInputErrorsTest` and `RunTest`: 47 tests, all pass.
   
   **Tried for real.** A Spring Boot app with `camel-spring-boot-starter` 
4.24.0-SNAPSHOT and plain `camel-chaos`, run with `spring-boot:run` and the JVM 
arguments this change produces. Spring Boot 4.1.2 was pinned, because 4.2.0 is 
not on Central yet. Results:
   - chaos switched on;
   - the scenario loaded from a path with a space;
   - rule `endpoint=log:* error` fired 6 times;
   - the report file was written at shutdown with verdict PASS.
   
   _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