Spring Data 2026.0.0-M2 released

Releases | Mark Paluch | March 13, 2026 | 2 min read | ...

On behalf of the team and everyone who has contributed, I'm pleased to announce the second milestone of the 2026.0.0 release train.

Annotation-driven Redis Pub/Sub listeners

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.

Conditional SET and DEL

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));

Revised MongoDB Bulk API

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.

2026.0.0-M2

Get the Spring newsletter

Stay connected with the Spring newsletter

Subscribe

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

Tanzu Spring offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all