Redis Connector 5.1 Reference - Mule 4
Release Notes: Redis Connector Release Notes
| You can set configurations in Expression mode, except when Redis Connector is used in conjunction with Object Store Connector, which does not support Expression mode. |
Configurations
Redis
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Name |
String |
The name for this configuration. Connectors reference the configuration with this name. |
x |
|
Connection |
The connection types to provide to this configuration. |
x |
||
Expiration Policy |
Configures the minimum amount of time that a dynamic configuration instance can remain idle before the runtime considers it eligible for expiration. This does not mean that the platform expires the instance at the exact moment that it becomes eligible. The runtime purges the instances when it sees fit. |
Connection Types
Clustered
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Cluster Hosts |
String |
Redis cluster hosts separated by comma and having format host:port. Use this field when you want to access you Redis cluster through connector. |
x |
|
Connection Timeout |
Number |
Connection timeout in milliseconds. |
2000 |
|
Entry TTL |
Number |
The default time to live to be set on keys stored through connector. |
||
Reconnection |
When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy |
|||
Max Total |
Number |
8 |
||
Max Idle |
Number |
8 |
||
Min Idle |
Number |
0 |
||
Lifo |
Boolean |
true |
||
Fairness |
Boolean |
false |
||
Max Wait Millis |
Number |
-1 |
||
Min Evictable Idle Time Millis |
Number |
1800000 |
||
Soft Min Evictable Idle Time Millis |
Number |
1800000 |
||
Num Tests Per Eviction Run |
Number |
3 |
||
Test On Create |
Boolean |
false |
||
Test On Borrow |
Boolean |
false |
||
Test On Return |
Boolean |
false |
||
Test While Idle |
Boolean |
false |
||
Time Between Eviction Runs Millis |
Number |
-1 |
||
Block When Exhausted |
Boolean |
true |
||
Jmx Enabled |
Boolean |
true |
||
Jmx Name Prefix |
String |
pool |
||
Jmx Name Base |
String |
NonClustered
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Host |
String |
Redis host. Use this field when you want to access you Redis server that is not part of a cluster through connector. |
localhost |
|
Port |
Number |
Redis port. The port on which your non cluster server is running. |
6379 |
|
Connection Timeout |
Number |
Connection timeout in milliseconds. |
2000 |
|
Password |
String |
Redis password. Set this in case that the server requires authentication. |
||
Entry TTL |
Number |
The default time to live to be set on keys stored through connector. |
||
Reconnection |
When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy |
|||
Max Total |
Number |
8 |
||
Max Idle |
Number |
8 |
||
Min Idle |
Number |
0 |
||
Lifo |
Boolean |
true |
||
Fairness |
Boolean |
false |
||
Max Wait Millis |
Number |
-1 |
||
Min Evictable Idle Time Millis |
Number |
1800000 |
||
Soft Min Evictable Idle Time Millis |
Number |
1800000 |
||
Num Tests Per Eviction Run |
Number |
3 |
||
Test On Create |
Boolean |
false |
||
Test On Borrow |
Boolean |
false |
||
Test On Return |
Boolean |
false |
||
Test While Idle |
Boolean |
false |
||
Time Between Eviction Runs Millis |
Number |
-1 |
||
Block When Exhausted |
Boolean |
true |
||
Jmx Enabled |
Boolean |
true |
||
Jmx Name Prefix |
String |
pool |
||
Jmx Name Base |
String |
Operations
Add To Set
<redis:add-to-set>
Add the message payload to the set stored at the specified key. If key does not exist, a new key holding a set is created.
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Key |
String |
Key to use for SADD |
x |
|
Value |
String |
The value to set. |
|
|
Must Succeed |
Boolean |
If true, ensures that adding to the set was successful (that is, no pre-existing identical value in the set) |
false |
|
Target Variable |
String |
The name of a variable to store the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output and store the expression outcome in the target variable |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Add To Sorted Set
<redis:add-to-sorted-set>
Add the message payload with the desired score to the sorted set stored at the specified key. If key does not exist, a new key holding a sorted set is created.
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Key |
String |
Key to use for ZADD |
x |
|
Value |
String |
The value to set. |
|
|
Score |
Number |
Score to use for the value |
x |
|
Must Succeed |
Boolean |
If true, ensures that adding to the sorted set was successful (ie no pre-existing identical value in the set) |
false |
|
Target Variable |
String |
The name of a variable to store the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output and store the expression outcome in the target variable |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Decrement
<redis:decrement>
Decrements the number stored at key by step. If the key does not exist, it is set to 0 before performing the operation. An error is returned if the key contains a value of the wrong type or contains data that can not be represented as integer.
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Key |
String |
Key to use for DECR. |
x |
|
Step |
Number |
Step used for the increment. |
1 |
|
Target Variable |
String |
The name of a variable to store the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output and store the expression outcome in the target variable |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Del
<redis:del>
Remove the specified key. A key is ignored if it does not exist.
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Key |
String |
Key to use for DEL |
x |
|
Target Variable |
String |
The name of a variable to store the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output and store the expression outcome in the target variable |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Exists
<redis:exists>
Test if the specified key exists.
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Key |
String |
Key to use for EXISTS |
x |
|
Target Variable |
String |
The name of a variable to store the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output and store the expression outcome in the target variable |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Expire
<redis:expire>
Set a timeout on the specified key.
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Key |
String |
The key in the sorted set. |
x |
|
Seconds |
Number |
The time to live in seconds. |
x |
|
Target Variable |
String |
The name of a variable to store the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output and store the expression outcome in the target variable |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Expire At
<redis:expire-at>
Set a timeout in the form of a UNIX timestamp (Number of seconds elapsed since 1 Jan 1970) on the specified key.
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Key |
String |
The key in the sorted set. |
x |
|
Unix Time |
Number |
The UNIX timestamp in seconds. |
x |
|
Target Variable |
String |
The name of a variable to store the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output and store the expression outcome in the target variable |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Get
<redis:get>
Get the value of the specified key. If the key does not exist null is returned.
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Key |
String |
Key to use for GET |
x |
|
Target Variable |
String |
The name of a variable to store the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output and store the expression outcome in the target variable |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Get All From Hash
<redis:get-all-from-hash>
Get all fields and values of the hash stored at the specified key. If the field or the hash don’t exist, null is returned.
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Key |
String |
Key to use for HGETALL |
x |
|
Target Variable |
String |
The name of a variable to store the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output and store the expression outcome in the target variable |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Get From Hash
<redis:get-from-hash>
Get the value stored at the specified field in the hash at the specified key. If the field or the hash don’t exist, null is returned.
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Key |
String |
Key to use for HGET |
x |
|
Field |
String |
Field to use for HGET |
x |
|
Target Variable |
String |
The name of a variable to store the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output and store the expression outcome in the target variable |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Get Range By Index
<redis:get-range-by-index>
Retrieve a range of values from the sorted set stored at the specified key. The range of values is defined by indices in the sorted set and sorted as desired.
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Key |
String |
Key to use for ZRANGE/ZREVRANGE |
x |
|
Start |
Number |
Range start index |
x |
|
End |
Number |
Range end index |
x |
|
Ascending Order |
Boolean |
Index order for sorting the range. If the parameter is set to true, the range is sorted in ascending order. If the parameter is set to false, the range is sorted in descending order. |
true |
|
Target Variable |
String |
The name of a variable to store the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output and store the expression outcome in the target variable |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Get Range By Score
<redis:get-range-by-score>
Retrieve a range of values from the sorted set stored at the specified key. The range of values is defined by scores in the sorted set and sorted as desired.
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Key |
String |
Key to use for ZRANGEBYSCORE and ZREVRANGEBYSCORE |
x |
|
Min |
Number |
Range start score |
x |
|
Max |
Number |
Range end score |
x |
|
Ascending Order |
Boolean |
Score order for sorting the range. If the parameter is set to true, the range is sorted in ascending order. If the parameter is set to false, the range is sorted in descending order. |
true |
|
Target Variable |
String |
The name of a variable to store the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output and store the expression outcome in the target variable |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Get TTL
<redis:get-ttl>
Get the remaining time to live in seconds of a volatile key.
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Key |
String |
The key in the sorted set. |
x |
|
Target Variable |
String |
The name of a variable to store the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output and store the expression outcome in the target variable |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Increment
<redis:increment>
Increments the number stored at key by step. If the key does not exist, it is set to 0 before performing the operation. An error is returned if the key contains a value of the wrong type or contains data that can not be represented as integer.
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Key |
String |
Key to use for INCR. |
x |
|
Step |
Number |
Step used for the increment. |
1 |
|
Target Variable |
String |
The name of a variable to store the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output and store the expression outcome in the target variable |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Increment Hash
<redis:increment-hash>
Increments the number stored at field in the hash stored at key by increment. If key does not exist, a new key holding a hash is created. If field does not exist the value is set to 0 before the operation is performed.
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Key |
String |
Key to use for HGET |
x |
|
Field |
String |
Field to use for HGET |
x |
|
Step |
Number |
Step used for the increment. |
1 |
|
Target Variable |
String |
The name of a variable to store the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output and store the expression outcome in the target variable |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Increment Sorted Set
<redis:increment-sorted-set>
Increments the score of member in the sorted set stored at key by increment. If member does not exist in the sorted set, it is added with increment as its score (as if its previous score was 0.0). If key does not exist, a new sorted set with the specified member as its sole member is created.
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Key |
String |
The key in the sorted set. |
x |
|
Value |
String |
The value to set. |
|
|
Step |
Number |
The step to use to increment the score. |
x |
|
Target Variable |
String |
The name of a variable to store the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output and store the expression outcome in the target variable |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Persist
<redis:persist>
Undo an expire or expireAt, turning the volatile key into a normal key.
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Key |
String |
The key in the sorted set. |
x |
|
Target Variable |
String |
The name of a variable to store the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output and store the expression outcome in the target variable |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Pop From List
<redis:pop-from-list>
Pop a value from the desired side of the list stored at the specified key.
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Key |
String |
Key to use for LPOP/RPOP |
x |
|
Pop Left |
boolean |
The side from which to pop the value. If the parameter is true, the value is popped from the left side. If the parameter is false, the value is popped from the right side. |
false |
|
Target Variable |
String |
The name of a variable to store the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output and store the expression outcome in the target variable |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Pop From Set
<redis:pop-from-set>
Pops a random value from the set stored at the specified key.
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Key |
String |
Key to use for SPOP |
x |
|
Target Variable |
String |
The name of a variable to store the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output and store the expression outcome in the target variable |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Publish
<redis:publish>
Publish the message payload to the specified channel.
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Channel |
String |
Destination of the published message |
x |
|
Message |
String |
The message to publish. |
x |
|
Target Variable |
String |
The name of a variable to store the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output and store the expression outcome in the target variable |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Push To List
<redis:push-to-list>
Push the message payload to the desired side (LEFT or RIGHT) of the list stored at the specified key. If key does not exist, a new key holding a list is created as long as ifExists is not true.
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Key |
String |
Key to use for LPUSH or RPUSH, or LPUSHX or RPUSHX. |
x |
|
Value |
String |
The value to push. |
|
|
Push Left |
Boolean |
Side that receives the pushed payload. If the parameter is true, push the payload on the left side. If the parameter is false, push the payload on the right side. |
false |
|
If Exists |
Boolean |
If the parameter is true, execute LPUSHX or RPUSHX. If the parameter is false, execute LPUSH or RPUSH. |
false |
|
Target Variable |
String |
The name of a variable to store the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output and store the expression outcome in the target variable |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Random Member From Set
<redis:random-member-from-set>
Reads a random value from the set stored at the specified key.
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Key |
String |
Key to use for SRANDMEMBER |
x |
|
Target Variable |
String |
The name of a variable to store the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output and store the expression outcome in the target variable |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Set
<redis:set>
Set key to hold the payload. If key already holds a value, it is overwritten, regardless of its type as long as ifNotExists is false.
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Key |
String |
Key used to store payload |
x |
|
Value |
String |
The value to set. |
|
|
Expire |
Number |
Set a timeout on the specified key in seconds. After the timeout the key is automatically deleted by the server. A key with an associated timeout is said to be volatile in Redis terminology. |
||
If Not Exists |
Boolean |
If true, then execute SETNX on the Redis server, otherwise execute SET. |
false |
|
Target Variable |
String |
The name of a variable to store the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output and store the expression outcome in the target variable. |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Set In Hash
<redis:set-in-hash>
Set the specified hash field to the message payload. If key does not exist, a new key holding a hash is created as long as ifNotExists is true.
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Key |
String |
Key to use for HSET |
x |
|
Value |
String |
The value to set. |
|
|
Field |
String |
Field to use for HSET |
||
If Not Exists |
Boolean |
If true execute HSETNX, otherwise HSET. |
false |
|
Target Variable |
String |
The name of a variable to store the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output and store the expression outcome in the target variable. |
|
|
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Sources
Subscribe
<redis:subscribe>
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Channels |
Array of String |
A list of channel names or globbing patterns. |
x |
|
Output Mime Type |
String |
The mime type of the payload that this operation outputs. |
||
Primary Node Only |
Boolean |
Whether this source should only be executed on the primary node when running in a cluster. |
||
Streaming Strategy |
|
Configure to use repeatable streams. |
||
Redelivery Policy |
Defines a policy for processing the redelivery of the same message. |
|||
Reconnection Strategy |
A retry strategy in case of connectivity errors. |
Types
Reconnection
| Field | Type | Description | Default Value | Required |
|---|---|---|---|---|
Fails Deployment |
Boolean |
When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy. |
||
Reconnection Strategy |
The reconnection strategy to use. |
Reconnect
| Field | Type | Description | Default Value | Required |
|---|---|---|---|---|
Frequency |
Number |
How often in milliseconds to reconnect. |
||
Count |
Number |
How many reconnection attempts to make. |
||
blocking |
Boolean |
If false, the reconnection strategy runs in a separate, non-blocking thread. |
true |
Reconnect Forever
| Field | Type | Description | Default Value | Required |
|---|---|---|---|---|
Frequency |
Number |
How often in milliseconds to reconnect. |
||
blocking |
Boolean |
If false, the reconnection strategy runs in a separate, non-blocking thread. |
true |
Expiration Policy
| Field | Type | Description | Default Value | Required |
|---|---|---|---|---|
Max Idle Time |
Number |
A scalar time value for the maximum amount of time a dynamic configuration instance should be allowed to be idle before it’s considered eligible for expiration. |
||
Time Unit |
Enumeration, one of:
|
A time unit that qualifies the maxIdleTime attribute |
Repeatable In Memory Stream
| Field | Type | Description | Default Value | Required |
|---|---|---|---|---|
Initial Buffer Size |
Number |
The amount of memory that will be allocated to consume the stream and provide random access to it. If the stream contains more data than can be fit into this buffer, then the buffer expands according to the bufferSizeIncrement attribute, with an upper limit of maxInMemorySize. |
||
Buffer Size Increment |
Number |
This is by how much the buffer size will be expanded if it exceeds its initial size. Setting a value of zero or lower means that the buffer should not expand, meaning that a STREAM_MAXIMUM_SIZE_EXCEEDED error is raised when the buffer gets full. |
||
Max Buffer Size |
Number |
The maximum amount of memory to use. If more than that is used then a STREAM_MAXIMUM_SIZE_EXCEEDED error is raised. A value lower than or equal to zero means no limit. |
||
Buffer Unit |
Enumeration, one of:
|
The unit in which all these attributes are expressed |
Repeatable File Store Stream
| Field | Type | Description | Default Value | Required |
|---|---|---|---|---|
Max In Memory Size |
Number |
Defines the maximum memory that the stream should use to keep data in memory. If more than that is consumed then it will start to buffer the content on disk. |
||
Buffer Unit |
Enumeration, one of:
|
The unit in which maxInMemorySize is expressed |
Redelivery Policy
| Field | Type | Description | Default Value | Required |
|---|---|---|---|---|
Max Redelivery Count |
Number |
The maximum number of times a message can be redelivered and processed unsuccessfully before triggering process-failed-message |
||
Use Secure Hash |
Boolean |
Whether to use a secure hash algorithm to identify a redelivered message. |
||
Message Digest Algorithm |
String |
The secure hashing algorithm to use. If not set, the default is SHA-256. |
||
Id Expression |
String |
Defines one or more expressions to use to determine when a message has been redelivered. This property may only be set if useSecureHash is false. |
||
Object Store |
Object Store |
The object store where the redelivery counter for each message is going to be stored. |



