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.

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: ${!metadata: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

string The URL of the target Redis instance.

operator

string The operator to apply.

Options are: scard, sadd.

key

string A key to use for the target operator.

This field supports interpolation functions.

retries

number The maximum number of retries before abandoning a request.

retry_period

string The time to wait before consecutive retry attempts.

parts

array 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.