
Redis - Studio - Mule 4
To configure a connector in Anypoint Studio:
-
Install the connector from either Anypoint Exchange or from within Anypoint Studio.
-
Configure the connector.
-
Configure an input source for the connector.
Install the Connector Using Exchange
-
In Studio, create a Mule project.
-
Click the Exchange (X) icon in the upper left of the Studio task bar.
-
In Exchange, click Login and supply your Anypoint Platform username and password.
-
In Exchange, search for
Redis
. -
Select the Redis Connector, click Add to project.
-
Follow the prompts to install the connector.
Install the Connector in Studio
-
In Studio, create a Mule project.
-
In the Mule Palette, click (X) Search in Exchange.
-
In Add Modules to Project, type
Redis
in the search field. -
Click the Redis Connector name in Available modules.
-
Click Add.
-
Click Finish.
Configure the Connector
To use Redis connector in your Mule app, configure a global Redis element that can be used by all instances of the Redis Connector in your app.
The sections that follow provide the properties to configure the global element.
Non-Cluster Configuration

In this image, the placeholder values refer to a configuration file placed in the src
folder of your project. You can either code your credentials into the global configuration properties, or reference a configuration file that contains these values. For simpler maintenance and better reusability of your project, Mule recommends that you use a configuration file. Keeping these values in a separate file is useful if you need to deploy to different environments, such as production, development, and QA, where your access credentials differ.
Field | Description |
---|---|
Name |
Enter a name for this configuration to reference it later. |
Host |
Redis host. Use this field when you want to access a Redis server that is not part of a cluster through the connector. |
Port |
Redis port. The port on which a non-cluster server is running. |
Connection Timeout |
Connection timeout in milliseconds. |
Entry Ttl |
The default time to live to be set on keys stored through the connector. |
Password |
Redis password. Set this in case that the server requires authentication. |
Cluster Configuration

Field | Description |
---|---|
Name |
Enter a name for this configuration to reference it later. |
Cluster Hosts |
Redis cluster hosts, separated by commas and with the format host:port. Use this field when you want to access a Redis cluster through the connector. |
Connection Timeout |
Connection timeout in milliseconds. |
Entry Ttl |
The default time to live to be set on keys stored through the connector. |
Configure an Input Source
Configure an input source for the connector such as a connector operation, using an HTTP Listener, or Scheduler.
Redis provides the Subscribe operation for use as an input source.
<redis:subscribe>
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 |
RedeliveryPolicy |
Defines a policy for processing the redelivery of the same message. |
||
Reconnection Strategy |
|
A retry strategy in case of connectivity errors. |
Next Step
After completing configuration, see the Additional Configuration Information and Examples.