Micronaut Framework 4.0 sets a baseline for Java to 17.
Micronaut Framework 4.x supports Apache Groovy 4.0
Micronaut Framework 4.0 supports Kotlin 1.8.0.
Since Java 19, the JVM includes experimental support for virtual threads project loom
. As it is a preview feature, you need to pass --enable-preview
as a JVM parameter to enable it.
The Micronaut framework will detect virtual thread support and use it for the executor named blocking if available. If virtual threads are not supported, this executor will be aliased to the io thread pool.
To use the blocking executor, simply mark e.g. a controller with ExecuteOn
:
@Controller("/hello")
class HelloWorldController {
@ExecuteOn(TaskExecutors.BLOCKING)
@Produces(MediaType.TEXT_PLAIN)
@Get("/world")
String index() {
return "Hello World";
}
}
Micronaut Framework has offered support for Kotlin via Kapt.
With version 4.0, Micronaut Framework supports Kotlin also via Kotlin Symbol Processing (KSP) API.
Please note that kapt
is in maintenance mode. Micronaut Kotlin users should move to our KSP support.
kapt is in maintenance mode. We are keeping it up-to-date with recent Kotlin and Java releases but have no plans to implement new features.
Since the Micronaut Framework 4.0, you can use two implementation of the Micronaut HTTP Client. The current implementation based on Netty and a new implementation based on Java HTTP Client(JEP 321).
To use the new implementation, add the following dependency.
To you Gradle build:
dependencies {
...
implementation("io.micronaut:micronaut-http-client-javanet")
}
Or to your Maven build:
...
<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-http-client-javanet</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>
TODO
- Injection of Maps
- Support arbitrary nesting of EachProperty/ConfigurationProperties beans
- Connection Pooling and HTTP/2
- Support custom HTTP status codes
- Conversion Service
- Performance Improvements
Bean Listeners are loaded lazily.
TODO
TODO
Logback 1.4.5 and SLF4J 2.0.4
TODO
micronaut-runtime
does not expose io.micronaut:micronaut-jackson-databind
anymore.. You have to choose whether to use Micronaut Serialization or Jackson Databind.
micronaut-core
does not expose SnakeYAML as transitive dependency anymore.. To continue to use YAML for application configuration, add the org.yam:snakeyaml
dependency to your application.
TODO
The micronaut-runtime
module has been split into separate modules depending on the application's use case:
The base service discovery features are now in a separate module. If your application listens for events such as ServiceReadyEvent or api:discovery.heartbeat.HeartBeatEvent[] add the following dependency.
To you Gradle build:
dependencies {
...
implementation("io.micronaut:micronaut-discovery")
}
Or to your Maven build:
...
<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-discovery</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>
dependency::[]
The retry implementation including annotations such as Retryable is now a separate module that can be optionally included in a Micronaut application.
In addition, since micronaut-retry
is now optional declarative clients annotated with ann:http.client.annotation.Client[] no longer invoke fallbacks by default. To restore the previous behaviour add micronaut-retry
to your classpath and annotate any declarative clients with @Recoverable.
To use the Retry functionality, add the following dependency.
To you Gradle build:
dependencies {
...
implementation("io.micronaut:micronaut-retry")
}
Or to your Maven build:
...
<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-retry</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>
io.micronaut:micronaut-http-server
no longer exposes micrnoaut-websocket
transitively. If your application uses annotations such as @ServerWebSocket
, add the micronaut-websocket
dependency.
To you Gradle build:
dependencies {
...
implementation("io.micronaut:micronaut-websocket")
}
Or to your Maven build:
...
<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-websocket</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>
Micronaut Session has been moved to its own module. If you use the HTTP session module, change the maven coordinates from io.micronaut:micronaut-session
to io.micronaut.session:micronaut-session
.
micronaut-http-server-netty
module no longer depends on micronaut-discovery
, micronaut-health
and micronaut-websocket
TODO
bom
-> core-bom
BOM
TODO