api

http4k / org.http4k.chaos / ChaosEngine

ChaosEngine

class ChaosEngine : Filter

The Chaos Engine controls the lifecycle of applying Chaotic behaviour to traffic, which is exposed as a standard Http4k Filter. Chaos can be programmatically updated and enabled/disabled. By default, the engine is deactivated, so activate() needs to be called to witness any change in behaviour,

Constructors

Name Summary
<init> ChaosEngine(behaviour: Behaviour)
The Chaos Engine controls the lifecycle of applying Chaotic behaviour to traffic, which is exposed as a standard Http4k Filter. Chaos can be programmatically updated and enabled/disabled. By default, the engine is deactivated, so activate() needs to be called to witness any change in behaviour,ChaosEngine(initialStage: Stage = Wait)

Functions

Name Summary
disable Turn off Chaos Engine. No Chaotic behaviour will be applied.fun disable(): ChaosEngine
enable Turn on Chaos Engine using the pre-initialised chaotic behaviour. Note that this may not actually produce any effect based on the configured behaviour (e.g. if there is a specific Trigger that is condition-based.)fun enable(): ChaosEngine
Update with new simple Chaotic behaviour to be applied whenever the ChaosEngine is enabled.fun enable(behaviour: Behaviour): ChaosEngine
Update the new complex (multi-stage, triggers etc) Chaotic behaviour to be applied whenever the ChaosEngine is enabled.fun enable(stage: Stage): ChaosEngine
invoke fun invoke(p1: HttpHandler): HttpHandler
isEnabled Check if the configured Chaos behaviour is currently being applied to all traffic.fun isEnabled(): Boolean
toString Outputs description of the current state.fun toString(): String

Extension Functions

Name Summary
appliedWhen fun Behaviour.appliedWhen(trigger: Trigger): Stage
inIntelliJOnly fun Filter.inIntelliJOnly(): Filter
then fun Filter.then(next: Filter): Filter
fun Filter.then(next: HttpHandler): HttpHandler
fun Filter.then(routingHttpHandler: RoutingHttpHandler): RoutingHttpHandler
then fun Filter.then(appLoader: AppLoader): AppLoader
fun Filter.then(appLoader: AppLoaderWithContexts): <ERROR CLASS>