The publish/subscribe messaging pattern

Redis also includes an implementation of the publish/subscribe messaging pattern. This section demonstrates how we can use Spring Data Redis for the purpose of sending and receiving messages. As an example, we will modify the CRUD application that stores the contact information as JSON to send notifications when a new contact is added, contact information is updated, and a contact is deleted.

We can implement this requirement by performing the following steps:

  1. Create message listeners that process the received messages.
  2. Configure the application context of our application.
  3. Send messages by using the RedisTemplate class.

This section also describes how we can ensure that our implementation is working correctly. ...

Get Spring Data now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.