Skip to content

Lettuce Redis Connector

A low-level connector providing Mule applications with direct access to Redis commands, built on the Lettuce reactive Redis client library. Published on Maven Central under cloud.anypoint.

The connector's goal is to provide full coverage of all documented Redis commands, organized by Redis data structure. For commands not yet implemented as dedicated operations, the Send Command operation lets you execute any arbitrary Redis command.

Features

  • Broad command coverage: Dedicated operations for strings, hashes, lists, sets, sorted sets, geospatial indexes, and streams
  • Pub/Sub event sources: Trigger Mule flows in real time from Redis channels using SUBSCRIBE and PSUBSCRIBE
  • Dynamic command execution: Send Command executes any Redis command not yet available as a dedicated operation
  • Automated SCAN iteration: Search Operations handle Redis cursor management internally, streaming full result sets without manual loop logic
  • Maven Central: Install with a single Maven dependency — no local builds required

Quick Example

xml
<!-- Standard Redis configuration -->
<lettuce-redis:config name="Redis_Config">
    <lettuce-redis:connection
        host="localhost"
        port="6379"
        tls="false"
        password="${secure::redis.password}"/>
</lettuce-redis:config>

<!-- Store a value -->
<lettuce-redis:set config-ref="Redis_Config" key="greeting" value="hello"/>

<!-- Retrieve it -->
<lettuce-redis:get config-ref="Redis_Config" key="greeting"/>

<!-- payload is now "hello" -->
<logger level="INFO" message="#[payload]"/>

Supported Command Categories

CategoryOperationsPage
ServerPINGServer
Key / ValueAPPEND, COPY, DECR, DEL, EXPIRE, GET, GETDEL, GETEX, GETRANGE, GETSET, INCR, MGET, MSET, PERSIST, PEXPIRE, PTTL, SCAN, SET, TOUCH, TTLKey / Value
HashHEXISTS, HGET, HGETALL, HINCRBY, HLEN, HMGET, HSCAN, HSETHash
ListBLMOVE, BLPOP, BRPOP, LMOVE, LPOP, LPUSH, LSET, RPOP, RPUSHList
SetSADD, SCARD, SDIFF, SISMEMBER, SMEMBERS, SMISMEMBER, SPOP, SRANDMEMBER, SREM, SSCANSet
Sorted SetZADD, ZINCRBY, ZRANK, ZSCAN, ZSCORESorted Set
GeospatialGEOADD, GEODIST, GEOPOS, GEOSEARCHGeospatial
StreamXACK, XADD, XDEL, XGROUP CREATE, XGROUP DESTROY, XINFO GROUPS, XRANGE, XREAD, XREADGROUP, XTRIMStream
ChannelPUBLISHChannel
Send CommandAny Redis command (dynamic)Send Command
Search OperationsAutomated SCAN, HSCAN, SSCAN, ZSCAN iterationSearch Operations
Sources (Listeners)SUBSCRIBE, PSUBSCRIBESources

Requirements

  • Mule Runtime: 4.6.0 or later
  • Java: 8, 11, or 17
  • Redis: Any version supporting the commands you use

Learn More

Released under the MIT License.