jamesnetherton commented on code in PR #9625: URL: https://github.com/apache/camel-quarkus/pull/9625#discussion_r4786301658
########## integration-tests-jvm/chaos/src/main/resources/application.properties: ########## @@ -0,0 +1,19 @@ +## --------------------------------------------------------------------------- +## Licensed to the Apache Software Foundation (ASF) under one or more +## contributor license agreements. See the NOTICE file distributed with +## this work for additional information regarding copyright ownership. +## The ASF licenses this file to You under the Apache License, Version 2.0 +## (the "License"); you may not use this file except in compliance with +## the License. You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## --------------------------------------------------------------------------- +camel.chaos.enabled=true Review Comment: Done. The test now uses `%test.camel.chaos.enabled=true`, and I removed the unused seed. ########## extensions-jvm/chaos/runtime/src/main/doc/usage.adoc: ########## @@ -0,0 +1,42 @@ +=== 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. To switch it on, for example in a test, set: + +[source,properties] +---- +%test.camel.chaos.enabled = true +---- + +To keep chaos off in dev mode, set `camel.chaos.enabled=false`. + +[WARNING] +==== +The Quarkus `prod` profile does not set the Camel profile. A packaged application therefore runs with no Camel profile, and +`camel.chaos.enabled=true` switches chaos on. + +To make sure that chaos can never be switched on in production, set `%prod.camel.main.profile=prod`. +This profile also sets the Camel security policy to `fail`, so an application with insecure settings, such as +`camel.ssl.trustAllCertificates=true`, does not start. + +Alternatively, set `%prod.camel.chaos.enabled=false`. This does not change the security policy, but the setting can be +overridden, for example with a system property or an environment variable. +==== + +=== 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. Review Comment: They don't. The rules and the report are lost on reload, while rules from `camel.chaos.rules` are added again. I've added this to the docs. ########## extensions-jvm/chaos/runtime/src/main/doc/usage.adoc: ########## @@ -0,0 +1,42 @@ +=== 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. To switch it on, for example in a test, set: + +[source,properties] +---- +%test.camel.chaos.enabled = true +---- + +To keep chaos off in dev mode, set `camel.chaos.enabled=false`. + +[WARNING] Review Comment: We'd prefer to keep parity with Camel. Its security model lists `camel.chaos.enabled=true` as an explicit operator opt-in. Chaos is off by default in packaged apps and logs a WARN when switched on. A check on the Quarkus `prod` profile would also miss custom production profiles. We've simplified the docs to recommend profile-specific configuration. -- 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]
