This version is still in development and is not considered stable yet. For the latest stable version, please use Spring Data Redis 4.0.5!

Pub/Sub Messaging

Spring Data provides dedicated messaging integration for Redis, similar in spirit to the JMS support in Spring Framework.

Redis messaging can be roughly divided into two areas of functionality:

This is an example of the pattern often referred to as Publish/Subscribe (Pub/Sub). On the sending side, you can publish messages through the low-level RedisConnection contract, through RedisOperations (typically backed by RedisTemplate), or through the message-oriented RedisMessageSendingTemplate. For asynchronous reception similar to Java EE’s message-driven bean style, Spring Data provides a dedicated message listener container that is used to create Message-Driven POJOs (MDPs) and, for synchronous reception, the RedisConnection contract.

The org.springframework.data.redis.connection and org.springframework.data.redis.listener packages provide the core functionality for Redis messaging.

The org.springframework.data.redis.annotation package provides the necessary infrastructure to support annotation-driven listener endpoints by using @RedisListener.

The org.springframework.data.redis.config package provides the parser implementation for the redis namespace as well as the Java config support to configure listener endpoints.