Get ahead
VMware offers training and certification to turbo-charge your progress.
Learn moreOn behalf of the team and everyone who has contributed, I'm pleased to announce the second milestone of the 2026.0.0 release train.
Spring Data Redis now supports annotation-driven listener endpoints for Pub/Sub, built on Spring Messaging.
@Component
public class MyService {
@RedisListener(topic = "my-channel")
public void processMessage(String data) { ... }
@RedisListener("my-order-channels*")
public void processOrder(Order order, @Header("pattern") Topic pattern) {
...
}
}
Annotation-driven listeneners need to be enabled through @EnableRedisListeners on your configuration class.
Listener methods are wired against your primary RedisMessageListenerContainer bean.
Annotated methods can indicate a MIME type (such as @RedisListener(topic = "my-channel", consumes = "application/json")) to select a specific MessageConverter for the listener.
By default, RedisListenerEndpointRegistrar registers JSON converters depending on the presence of Jackson, Kotlin Serialization, and Gson on the classpath.
Compare-and-set and compare-and-delete functionality are available for Redis 8.4 users. By attaching value-based conditions to SET and DEL, you get compare-and-set and compare-and-delete behavior without extra round-trips.
To contain invariance of commands, we introduced a functional approach for set and delete operations allowing you to configure the command conditions and expiration:
Set the value with expected-value comparison and TTL:
valueOps.set(key, newValue, spec -> spec.ifEquals().value(expectedValue).expire(Duration.ofSeconds(10)));
Set the value with digest comparison, keeping existing TTL:
valueOps.set(key, newValue, spec -> spec.ifEquals().digest(expectedHex16Digest).expiration(Expiration.keepTtl()));
Delete only if the current value is not the one you pass:
redisTemplate.delete(key, it -> it.ifNotEquals().value(value));
We’ve streamlined how you handle batch changes. The new MongoOperations.bulkWrite allows for mixed insert, update, and delete actions in one go. If you're running MongoDB 8.0+, this works across multiple collections at once. Using an earlier version? You can still use the new API for single-collection bulk writes.
Bulk bulk = Bulk.create(builder -> builder.inCollection(Jedi.class, spec -> spec
.insert(new Jedi("Luke", "Skywalker"))
.insert(new Jedi("Leia", "Princess"))
.updateOne(where("firstname").is("Leia"), update("lastname", "Organa")))
.inCollection(Sith.class, spec -> spec.upsert(where("name").is("Darth Sidious"), update("realName", "Palpatine")))
);
BulkWriteResult result = operations.bulkWrite(bulk, BulkWriteOptions.ordered());
Going forward, we plan to ship a release candidate in April before releasing a generally available release in May. Spring Boot 4.1 M3 will upgrade to this milestone release for your convenience. Happy Upgrading and let us know what you think about these changes, especially if you encounter any issue.
You can find more details in our Release Notes.
4.1 M2 - Javadoc - Documentation - Changelog4.1 M2 - Javadoc - Documentation - Changelog4.1 M2 - Javadoc - Documentation - Changelog8.1 M2 - Javadoc - Documentation - Changelog5.1 M2 - Javadoc - Documentation - Changelog5.1 M2 - Javadoc - Documentation - Changelog4.1 M2 - Javadoc - Documentation - Changelog5.1 M2 - Javadoc - Documentation - Changelog4.1 M2 - Javadoc - Documentation - Changelog6.1 M2 - Javadoc - Documentation - Changelog6.1 M2 - Javadoc - Documentation - Changelog4.1 M2 - Javadoc - Documentation - Changelog