Skip to content

Spring Boot 4.1.0-M3 Released: Spring gRPC Support and File Rotation

Spring Boot 4.1.0-M3 (Milestone 3) is now available, and this release marks a significant moment in Spring’s history. It coincides with Spring Framework’s 22nd anniversary (first released on March 24, 2004) and precedes the 12th anniversary of Spring Boot 1.0 (April 1, 2014). But beyond the historical significance, this milestone brings two major features that developers have been waiting for: official Spring gRPC support and new file rotation capabilities.

Spring gRPC Support: Finally Here

gRPC has been one of the most requested features in the Spring ecosystem. If you’ve been following Spring’s development, you know the community has been asking for this for years. With Spring Boot 4.1.0-M3, we now have first-class gRPC support integrated directly into the framework.

Adding gRPC to Your Project

To get started with Spring gRPC, add the following dependency to your Maven project:

pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-grpc</artifactId>
</dependency>

This starter brings in everything you need to build gRPC services in Spring Boot, including auto-configuration and integration with Spring’s programming model.

Creating a gRPC Service

Here’s how simple it is to create a gRPC service with the new Spring support:

GrpcUserService.java
import org.springframework.grpc.server.service.GrpcService;
@GrpcService
public class GrpcUserService extends UserServiceGrpc.UserServiceImplBase {
@Override
public void getUser(GetUserRequest request,
StreamObserver<UserResponse> responseObserver) {
UserResponse response = UserResponse.newBuilder()
.setId(request.getId())
.setName("John Doe")
.setEmail("[email protected]")
.build();
responseObserver.onNext(response);
responseObserver.onCompleted();
}
@Override
public void createUser(CreateUserRequest request,
StreamObserver<UserResponse> responseObserver) {
// Create user logic here
UserResponse response = UserResponse.newBuilder()
.setId(UUID.randomUUID().toString())
.setName(request.getName())
.setEmail(request.getEmail())
.build();
responseObserver.onNext(response);
responseObserver.onCompleted();
}
}

The @GrpcService annotation works similarly to @Service or @RestController, making it familiar to any Spring developer. You can inject other Spring beans into your gRPC services just like any other component.

Why This Matters

Before this official support, developers had to use third-party libraries like grpc-spring-boot-starter or manually configure gRPC servers. Now we get:

  • Auto-configuration: No more boilerplate setup code
  • Spring-native: Full integration with Spring’s dependency injection and lifecycle
  • Production-ready: Built-in support for health checks, metrics, and tracing
  • Developer-friendly: Familiar annotations and programming model

File Rotation: Better Log Management

The second major feature in this release is native file rotation support. If you’ve ever dealt with log files growing uncontrollably in production, you’ll appreciate this addition.

Configuring File Rotation

Spring Boot now provides built-in file rotation configuration through application.yml:

application.yml
logging:
file:
name: logs/application.log
rotation:
max-size: 10MB
max-history: 30
total-size-cap: 1GB
clean-on-start: true

This configuration gives you:

  • max-size: Rotates files when they reach the specified size
  • max-history: Keeps a specified number of archived log files
  • total-size-cap: Limits total space used by all log files
  • clean-on-start: Cleans up old logs on application startup

Why This Matters

Previously, configuring log rotation required either:

  1. External tools like logrotate on Linux
  2. Complex Logback XML configurations
  3. Third-party libraries

Now it’s a simple YAML configuration. This is especially useful for:

  • Containerized applications: No need to configure host-level log rotation
  • Microservices: Each service can manage its own logs independently
  • Development environments: Easier local log management without external tools

Should You Upgrade?

As with any milestone release, you should evaluate whether the new features justify the upgrade. Consider upgrading if:

  • You’re planning to adopt gRPC in your microservices architecture
  • You want simpler log management configuration
  • You’re starting a new project and want the latest features

Keep in mind that milestone releases are not production-ready. Wait for the GA release for production deployments.

Looking Forward

Spring Boot 4.1.0-M3 demonstrates Spring’s continued evolution. The gRPC support addresses a long-standing community request, while file rotation simplifies a common operational concern. Both features follow Spring’s philosophy: sensible defaults with easy customization.

As we celebrate 22 years of Spring Framework, it’s clear the ecosystem continues to adapt to modern development needs. These additions make Spring Boot even more compelling for building cloud-native applications.

Final Words + More Resources

My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me

Here are also the most important links from this article along with some further resources that will help you in this scope:

Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!

Comments