|
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! |
Pub/Sub Messaging
Spring Data provides dedicated messaging integration for Redis, similar in functionality and naming to the JMS integration in Spring Framework.
Redis messaging can be roughly divided into two areas of functionality:
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.
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.