Contact Free trial Login

Redis - Studio - Mule 4

To configure a connector in Anypoint Studio:

  1. Install the connector from either Anypoint Exchange or from within Anypoint Studio.

  2. Configure the connector.

  3. Configure an input source for the connector.

Install the Connector Using Exchange

  1. In Studio, create a Mule project.

  2. Click the Exchange (X) icon in the upper left of the Studio task bar.

  3. In Exchange, click Login and supply your Anypoint Platform username and password.

  4. In Exchange, search for Redis.

  5. Select the Redis Connector, click Add to project.

  6. Follow the prompts to install the connector.

Install the Connector in Studio

  1. In Studio, create a Mule project.

  2. In the Mule Palette, click (X) Search in Exchange.

  3. In Add Modules to Project, type Redis in the search field.

  4. Click the Redis Connector name in Available modules.

  5. Click Add.

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

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

redis basic config clustered
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

  • repeatable-in-memory-stream

  • repeatable-file-store-stream

  • non-repeatable-stream

Configure to use repeatable streams.

Redelivery Policy

RedeliveryPolicy

Defines a policy for processing the redelivery of the same message.

Reconnection Strategy

  • reconnect

  • reconnect-forever

A retry strategy in case of connectivity errors.

Next Step

After completing configuration, see the Additional Configuration Information and Examples.

See Also

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.