redis

  • Fault injection according to the commands and key
note

This feature requires APISIX to be run on APISIX-Base.

It also requires the data sent from clients are well-formed and sane. Therefore, it should only be used in deployments where both the downstream and upstream are trusted.

Each Redis command is considered a request. However, the message subscribed from the server won’t be considered a request.

For example, when a Redis client subscribes to channel foo and receives the message bar, then it unsubscribes the channel, there are two requests: subscribe foo and unsubscribe foo.

NameType          RequiredDefault                                      Valid values                                                      Description                                                                                                                                                                                                                                          
commandsarray[string]        True                                                 [“get”, “mget”]  Commands fault is restricted to
keystring        False                                                 “blahblah”  Key fault is restricted to
delaynumber        True                                                 0.1  Duration of the delay in seconds

Assumed the APISIX is proxying TCP on port 9101, and the Redis is listening on port 6379.

Let’s create a Stream Route:

You can notice that there is a 5 seconds delay for the ping command.