redis

Performs actions against Redis that aren't possible using a cache processor. Actions are performed for each message of a batch, where the contents are replaced with the result.

# Common config fields, showing default values
redis:
url: tcp://localhost:6379
operator: scard
key: ""

The field key supports interpolation functions resolved individually for each message of the batch.

For example, given payloads with a metadata field set_key, you could add a JSON field to your payload with the cardinality of their target sets with:

- process_field:
path: meta.cardinality
result_type: int
processors:
- redis:
url: TODO
operator: scard
key: ${! meta("set_key") }

Operators

scard

Returns the cardinality of a set, or 0 if the key does not exist.

sadd

Adds a new member to a set. Returns 1 if the member was added.

Fields

url

The URL of the target Redis instance.

Type: string
Default: "tcp://localhost:6379"

operator

The operator to apply.

Type: string
Default: "scard"
Options: scard, sadd.

key

A key to use for the target operator. This field supports interpolation functions.

Type: string
Default: ""

retries

The maximum number of retries before abandoning a request.

Type: number
Default: 3

retry_period

The time to wait before consecutive retry attempts.

Type: string
Default: "500ms"

parts

An optional array of message indexes of a batch that the processor should apply to. If left empty all messages are processed. This field is only applicable when batching messages at the input level.

Indexes can be negative, and if so the part will be selected from the end counting backwards starting from -1.

Type: array
Default: []