This version is still in development and is not considered stable yet. For the latest stable version, please use Spring Data Redis 4.0.4!spring-doc.cn

Pub/Sub Messaging

Spring Data provides dedicated messaging integration for Redis, similar in functionality and naming to the JMS integration in Spring Framework.spring-doc.cn

Redis messaging can be roughly divided into two areas of functionality:spring-doc.cn

This is an example of the pattern often called Publish/Subscribe (Pub/Sub for short). The RedisTemplate class is used for message production. 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.spring-doc.cn

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

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

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.spring-doc.cn