Class FaultRule.Builder

java.lang.Object
org.apache.kafka.test.faultproxy.FaultRule.Builder
Enclosing class:
FaultRule

public static final class FaultRule.Builder extends Object
  • Method Details

    • forClient

      public FaultRule.Builder forClient(String substring)
      Scope this fault to requests whose clientId contains substring — e.g. forClient("restore") to fault only the restore consumer (leaving the main consumer and producer untouched). Without this, the rule matches any client.
    • once

      public FaultRule once()
      Fire on the first matching response only.
    • onCall

      public FaultRule onCall(int n)
      Fire on exactly the n-th matching response (1-based).
    • times

      public FaultRule times(int n)
      Fire on the first n matching responses.
    • everyTime

      public FaultRule everyTime()
      Fire on every matching response until removed.
    • withProbability

      public FaultRule withProbability(double p)
      Fire on each matching response with the given probability (chaos mode; non-deterministic).