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
| Category | Operations | Page |
|---|---|---|
| Server | PING | Server |
| Key / Value | APPEND, COPY, DECR, DEL, EXPIRE, GET, GETDEL, GETEX, GETRANGE, GETSET, INCR, MGET, MSET, PERSIST, PEXPIRE, PTTL, SCAN, SET, TOUCH, TTL | Key / Value |
| Hash | HEXISTS, HGET, HGETALL, HINCRBY, HLEN, HMGET, HSCAN, HSET | Hash |
| List | BLMOVE, BLPOP, BRPOP, LMOVE, LPOP, LPUSH, LSET, RPOP, RPUSH | List |
| Set | SADD, SCARD, SDIFF, SISMEMBER, SMEMBERS, SMISMEMBER, SPOP, SRANDMEMBER, SREM, SSCAN | Set |
| Sorted Set | ZADD, ZINCRBY, ZRANK, ZSCAN, ZSCORE | Sorted Set |
| Geospatial | GEOADD, GEODIST, GEOPOS, GEOSEARCH | Geospatial |
| Stream | XACK, XADD, XDEL, XGROUP CREATE, XGROUP DESTROY, XINFO GROUPS, XRANGE, XREAD, XREADGROUP, XTRIM | Stream |
| Channel | PUBLISH | Channel |
| Send Command | Any Redis command (dynamic) | Send Command |
| Search Operations | Automated SCAN, HSCAN, SSCAN, ZSCAN iteration | Search Operations |
| Sources (Listeners) | SUBSCRIBE, PSUBSCRIBE | Sources |
Requirements
- Mule Runtime: 4.6.0 or later
- Java: 8, 11, or 17
- Redis: Any version supporting the commands you use
Learn More
- Set Up Guide — Installation and connection configuration
- Operations Reference — All operations by category
- Sources (Listeners) — Pub/Sub event-driven flows
- GitHub Repository — Source code and issues