Chaos
JVM since4.0.0 Nativeunsupported
Turn on faults in a running Camel application during development, and report how the routes cope
Maven coordinates
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-chaos</artifactId>
</dependency> Check the User guide for more information about writing Camel Quarkus applications.
Usage
Switching chaos on
Chaos is intended for development only.
In Quarkus dev mode, chaos is switched on with no extra configuration, because Camel Quarkus sets the Camel profile to dev. Nothing happens to your routes until a rule is added.
Outside of dev mode, chaos is off by default. Use camel.chaos.enabled to switch it on or off, with a Quarkus profile to limit where it applies:
# Switch chaos on in tests
%test.camel.chaos.enabled = true
# Keep chaos off in dev mode
%dev.camel.chaos.enabled = false | Without a profile prefix, |
Managing the chaos rules
In dev mode, open the Quarkus Dev UI and choose the Chaos page of the Camel Chaos extension. It shows the rules and the report, and lets you add and remove rules while the application runs. The page is not available outside of dev mode.
Rules added on this page, and the report, are lost when the application reloads. To add rules again after each reload, set camel.chaos.rules.
Adding or removing rules does not reset the report. To start a new experiment, use Clear rules and reset report.
The rules and the report can also be read over HTTP. Add the Console extension, set quarkus.camel.console.enabled=true, and open /q/camel/dev-console/chaos. By default, this is available in dev and test mode only. See the Console extension for how to expose it in prod mode, and for the security implications.
To control chaos with the Camel CLI (camel cmd chaos-add, camel get chaos), add the CLI Connector extension.