Micronaut Framework 1 Upgrade Reference
These historical upgrade notes were migrated from the Micronaut Upgrade Guide archive.
Micronaut Framework 1.3.0
1.3.0 Breaking Changes
The following changes could potentially be considered to be breaking changes, however the likelihood of any negative impact is low.
-
The order of the configuration files provided by
MICRONAUT_CONFIG_FILESormicronaut.config.fileswas overriding system properties and environment variables. The files are now ordered between the environment and configuration files which means they will no longer override environment variables or system properties. In addition which file within the list had priority was non deterministic. Later files now have precedence over earlier files in the list. -
Routes that are binding to a body type that is a String, byte[], or ByteBuffer will no longer be decoded and the raw body will be bound directly to the argument. Because decoding is no longer happening, if a body is sent that is considered invalid according to the content type of the request, it will be bound to the body argument anyway. This is different than previous behavior where an exception would be thrown if the body was invalid.
-
Concrete types are now preferred when creating a class hierarchy. The most common case where this will have an impact is converters. Converters that match super classes of the target type will be preferred over converters that match an interface that the target type implements.
What’s new with 1.3.0
Support for GraalVM 20.0.0
Micronaut supports creating native-images using GraalVM 20.0.0 for both JDK 8 and JDK 11.
Startup and Memory Usage Optimizations
Startup performance and memory usage (20%) have been improved.
Micronaut Data Integration
Micronaut Data has been added to the micronaut-bom and you can now use the CLI to create Micronaut Data projects:
# add --build maven for maven
$ mn create-app myapp --features data-hibernate-jpa
# add --build maven for maven
$ mn create-app myapp --features data-jdbc
Initial Support for Kotlin Coroutines and Flow
Initial support for Kotlin Coroutines and the Flow type has been added when used as the return type of controller methods.
Thanks to Konrad Kamiński for this contribution.
Immutable @ConfigurationProperties and @EachProperty
Support for immutable ann:context.annotation.ConfigurationProperties[] has been added by annotating the constructor of any configuration class with ann:context.annotation.ConfigurationInject[]. See the documentation on Immutable Configuration for more information.
snippet::io.micronaut.docs.config.itfce.EngineConfig[tags="imports,class",indent=0,title="@ConfigurationProperties Example"]
-
The ann:context.annotation.ConfigurationProperties[] annotation takes the configuration prefix and is declared on an interface
-
You can use ann:core.bind.annotation.Bindable[] to set a default value if you want
-
Validation annotations can be used too
-
You can also specify references to other ann:context.annotation.ConfigurationProperties[] beans.
-
You can nest immutable configuration
-
Optional configuration can be indicated by returning an
Optionalor specifying@Nullable
Ability to Configure Log Levels via Properties
Log levels can now be configured via properties defined in application.yml (and environment variables) with the log.level prefix:
logger:
levels:
foo.bar: ERROR
New Micronaut Cache Modules
Micronaut Cache has been updated to support Hazelcast and Ehcache as additional Cache providers.
New Micronaut Jackson XML Module
Support for parsing and serializing to XML has been added with a new Jackson XML module.
dependency:micronaut-jackson-xml[groupId="io.micronaut.xml"]
Thanks to Sergey for this contribution.
Micronaut OpenAPI (Swagger) 1.3 Update
Micronaut OpenAPI has been updated with loads of improvements including the ability to automatically generate UIs for Swagger output as part of your application. Thanks to croudet for this awesome contribution.
The module is also no longer regarded as experimental.
Micronaut Views 1.3 Update
Micronaut Views has been updated to and now features a new view renderer for Soy (Closure Templates). Thanks to Sam Gammon for this contribution.
Micronaut SQL 1.3 Update
Micronaut SQL includes the latest versions of Hibernate and adds support for the Vert.x MySQL and Postgres Clients. Thank you to shenzhou-6 for this contribution.
Micronaut Micrometer 1.3 Update
Micronaut Micrometer has been updated to support Micrometer 1.3.1.
Micronaut Kafka 1.4 Update
Micronaut Kafka 1.4 has been updated to support Kafka 2.4.0
Micronaut Neo4j 1.3 Update
Micronaut Neo4j 1.3 has been updated to support Neo4j Java Driver 1.7.5. In additional a new 2.0.0 version is available that supports Neo4j Java Driver 4.x line which is the latest version (in order to maintain semantic versioning the default is still 1.3 since the latest version includes changes to package names). See the Micronaut Neo4j Documentation for more information.
Micronaut GRPC 1.1 Update
Micronaut GRPC has been updated to the latest versions of GRPC and Protobuf.
@Requires OS
The ann:context.annotation.Requires[] annotation now has support for disabling beans based on the current operating system.
@Requires(os=Family.LINUX)
Basic Auth binding support
In the client and server, an argument of type api:http.BasicAuth[] can be used to generate or parse a basic authorization header.
@Post("/login")
String login(BasicAuth basicAuth) {
...
}
Request Certificate
For SSL requests, the certificate is now available as a request attribute. See api:http.HttpRequest#getCertificate--[HttpRequest#getCertificate]
Client Filter Matching By Annotation
Micronaut HTTP clients and client filters can now be matched by the presence of an annotation. Previously only URL matching was supported. See the documentation to get started.
Dependency Upgrades
Required Third Party Dependencies:
-
ASM
7.0→7.2 -
Caffeine
2.5.6→2.8.0 -
Jackson
2.9.9→2.10.1 -
Reactive Streams
1.0.2→1.0.3
Optional Third Party Dependencies:
-
Micrometer
1.2.1→1.3.1 -
Mongo Reactive Driver
1.11.0→1.13.0 -
Neo4j Java Driver
1.7.2→1.7.5 -
Jaeger
0.35.5→1.0.0 -
Kafka
2.3.0→2.4.0 -
Spring
5.1.8→5.2.3 -
Zipkin/Brave
5.6.5→5.9.0 -
Groovy
2.5.7→2.5.8 -
Gradle
5.5→Gradle 6.1(for new applications) -
Hibernate Core
5.4.6.Final→5.4.10.Final
Modules:
-
Micronaut GRPC
1.0.1→1.1.1 -
Micronaut Kafka
1.2.0→1.4.0 -
Micronaut Micrometer
1.2.1→1.3.0 -
Micronaut MongoDB
1.1.0→1.2.0 -
Micronaut MongoDB
1.1.0→1.3.0 -
Micronaut Neo4j
1.1.0→1.3.0 -
Micronaut OpenAPI
1.2.0→1.3.0 -
Micronaut Redis
1.1.0→1.2.0 -
Micronaut SQL
1.2.3→1.3.0 -
Micronaut Views
1.2.0→1.3.0
Micronaut Framework 1.2.9
1.2.9 Breaking Changes
-
The data format was changed for multiline server sent event data payloads to conform to the specification. Previously multiline data did not have the required
data:prefix on each line and now it does.
Micronaut Framework 1.2.0
What’s new with 1.2.0
Support for GraalVM 19.3.0
Micronaut now supports creating native-images using GraalVM 19.3.0 for both JDK 8 and JDK 11.
Native Bean Validation Support
Hibernate Validator is no longer a required dependency to activate bean validation, with a new native implementation of Bean Validation available that is reflection free and supports reactive and AST level validations now available.
The micronaut-validation dependency is all that it is needed now and provides the following benefits over Hibernate Validator:
-
Reflection Free
-
Compile Time Computed Bean Metadata resulting in lower memory requirements
-
Reduction in JAR size by 2MB
-
Reduction in startup time by 300ms which was the cost of initializing Hibernate validator
-
Out-of-the-box GraalVM native image support
-
Reduction in GraalVM native image size by 10MB
Reactive Bean Validation Support
In previous versions of Micronaut manual validation had to be applied to reactive flows. You can now declare @Valid on method parameters that receive a reactive type and validation will automatically be applied.
Implicit @Validated and @Valid
It is no longer necessary to apply the ann:validation.Validated[] annotation to beans that accept @Valid arguments or use any javax.validation annotation.
Micronaut Kubernetes 1.0 Release
There is a new Micronaut Kubernetes module, with an improved support for running Micronaut applications in a Kubernetes cluster, including support for Kubernetes' ConfigMaps, Secrets and more.
To get started, use the kubernetes feature:
mn create-app my-app --features kubernetes
Micronaut Security 1.2 Update
Support for OAuth 2.0 and OpenID clients has been added to the Micronaut security module through a new dependency: micronaut-security-oauth2. It is now very easy to add support for login through an OAuth providers. See the Oauth section in the security documentation for more information.
Micronaut Micrometer 1.2 Update
Micronaut Micrometer has been updated to 1.2 which includes the following new features:
-
Update to Micrometer 1.2.0
-
Support for GraalVM native images
-
Meter registry support for AppOptics, Azure Monitor, Datadog, Dynatrace, Elastic, Ganglia, Humio, Influx, Jmx, Kairos, New Relic, SignalFX, Stackdriver and Wavefront
Thanks to Thiago Locatelli for this contribution.
Micronaut SQL 1.2 Update
The Micronaut SQL module has been updated with support for the following new features:
-
Improved Entity Scan support for JPA
-
Integration with Micronaut 1.2 Validator for JPA
-
GraalVM
native-imagemetadata -
Support for JOOQ. Thanks to Vladimir Kulev.
Micronaut Kafka 1.2 Update
The Micronaut Kafka module has been updated with support for the following new features:
-
Support for Kafka 2.3.0
-
Improved Exception Handling
-
Support for GraalVM
native-image
Micronaut Rabbit 1.1.1 Update
The Micronaut RabbitMQ module has been updated with support for GraalVM native-image.
Micronaut Test 1.1 Update
The Micronaut Test module has been updated with support for the following new features:
-
Updated to JUnit 5.5
-
Support for Dependency Injection in Constructors and Methods for JUnit 5
-
Support for Kotlin Test
Optional Beans Returned from Factories
A ann:context.annotation.Factory[] bean can now return null if it is not possible to create the bean which will indicate to the dependency injection container that the bean does not exist. This allows for more complex logic within factory beans that can conditionally disable the bean if certain conditions are not met.
HashiCorp Vault Support
Initial support distributed configuration for HashiCorp Vault has been added. See the documentation on HashiCorp Vault Support for more information. Thanks to Thiago Locatelli for this contribution.
Oracle Cloud Support
Initial support for environment detection and cloud metadata for Oracle Cloud has been added. Thanks to Todd Sharp for this contribution.
@Client and Manual Service Discovery
If a service is configured statically with micronaut.http.services.*, it was previously not possible to override the configuration with the ann:http.client.annotation.Client[] annotation. It is now possible to override the configuration, which will result in a new client being created for the given client class.
Completable Support
The RxJava2 reactive type io.reactivex.Completable is now supported as a return type for controller and client methods.
Client and Server Host Resolution
New beans have been added to support lookup of the client address and the current server host. The implementations are aware of proxy headers and are configurable to look for custom headers. The api:http.server.util.HttpHostResolver[] can be injected to resolve the current server hostname and api:http.server.util.HttpClientAddressResolver[] can be injected to resolve the client address of the current request.
Default Implementation Support
When writing libraries for Micronaut, it is often the case that users will want to override part of your implementation. The most common way of doing so is creating custom beans that use the ann:context.annotation.Replaces[] annotation to replace your implementation. Because the ann:context.annotation.Replaces[] annotation requires a class argument to indicate which implementation to replace, it was required to make the implementation part of the public API. The class needed to be public because the user would need to reference the class directly in the annotation.
A new annotation has been added to solve this problem: ann:context.annotation.DefaultImplementation[]. See the section on Bean Replacements for more information.
HEAD Routes
For each route registered with the server that responds to GET requests, an additional route will be registered that responds to HEAD requests and will not include the body. This only applies to routes created by Micronaut through annotations. Any GET routes registered by custom route builders will not have corresponding HEAD routes added automatically.
Request Scope
A new bean scope has been created to allow for beans that only exist in the scope of a given HTTP request. See ann:runtime.http.scope.RequestScope[].
Environment Order and Priority
In previous versions of Micronaut, the property sources for an active environment had no priority over any other active environment. It was non deterministic which environment’s properties would override other environments. Now the last environment supplied has the highest priority. For example, if an application is started with -Dmicronaut.environments=first,second, application-second.yml will override properties in application-first.yml. This change affects all sources of properties, including distributed configuration sources.
Environment Endpoint
This version includes a new /env endpoint with information about the environment and its property sources See the documentation for more information.
RSS 2.0 Module Included in BOM
This version references the RSS configuration which eases the generation of a RSS 2.0 feeds in a Micronaut app.
Dependency Upgrades
-
Groovy
2.5.4→2.5.6 -
Gradle
5.1.1→Gradle 5.5(for new applications) -
Micronaut SQL
1.1.1→1.2.0 -
Micronaut Micrometer
1.1.0→1.2.0 -
Micrometer
1.1.5→1.2.0 -
Micronaut Security
1.1.1→1.2.0 -
Micronaut Views
1.1.3→1.2.0 -
Micronaut Test
1.0.4→1.1.0 -
Netty
4.1.30.Final→4.1.43.Final -
Neo4j Driver
1.7.2→1.7.5 -
Mongo Driver
3.8.0→3.10.1 -
Mongo Reactive Streams
1.10.0→1.11.0 -
Kafka
2.1.1→2.3.0 -
Snake YAML
1.23→1.24 -
Lettuce
5.1.3.RELEASE→5.1.7.RELEASE -
JUnit
5.3.2→5.5.0 -
Picocli
3.5.2→4.0.1 -
Jaeger
0.33.1→0.35.5 -
Zipkin Reporter
2.8.4→2.10.0 -
Open Tracing
0.31.0→0.33.0
1.2.0 Breaking Changes
The following changes could potentially be considered to be breaking changes, however the likelihood of any negative impact is low.
-
The AWS distributed configuration through systems manager property store supported the notion of
key=valuein the value section of the configuration. This functionality has been removed because it did not consider properties that contain an=but are not in the format ofkey=value. -
The return of reactive types with a generic of
Voidhas been changed from always returning a 404 status to returning a 200, or whatever status is defined in the@Statusannotation. This includesCompletionStage, RxJava2, and Reactor types. The change was made to be consistent with the behavior of methods that returnvoid. -
Extending a
@ConfigurationPropertiesclass that contains a@ConfigurationBuilderonly allowed the builder to be configured through the child’s class prefix instead of the parent’s. This was a bug because the behavior is different compared to any other property on the parent class. Previously theparent.child.addressprefix would have been used to configure theaddressbuilder on the child class. With this changeparent.addresswill be used.
@ConfigurationProperties("parent")
class Parent {
@ConfigurationBuilder(configurationPrefix = "address")
...
}
@ConfigurationProperties("child")
class Child extends Parent {
}</code></pre>
Micronaut Framework 1.1.0
What’s new with 1.1.0
GraalVM 19 Native Image Support
Micronaut 1.1.2 is the first version to support GraalVM 19’s native image changes.
|
Note
|
Although GraalVM 19 is the first official stable release of GraalVM, Substrate and the native-image tool remain in early adopter / experimental status. Therefore support for native images in Micronaut also remains experimental at this stage.
|
Modularization
Micronaut is now modular with parts of Micronaut being shifted into sub-projects. See the following links for new sub-projects that now have independent release cycles outside of Micronaut core:
File Watch and Server Restart
A new Automatic Restart feature is included that allows the server to restart if a change occurs to a file. This feature can be used both in production and at development time to achieve automatic application restarts when changing source code (when combined with a third party tool such as Gradle or Kubernetes in production).
|
Tip
|
Using the CLI
$ mn create-app my-app --features file-watch $ cd my-app $ ./gradlew run --continuous |
GRPC Support
Support for creating GRPC + Micronaut applications has been added.
See the Micronaut GRPC documentation for more information and example applications.
|
Tip
|
Using the CLI
Use the CLI to quickly create a GRPC application. mn create-app helloworld --profile grpc --lang java --build gradle |
RabbitMQ Support
Support for creating Message-Driven Microservices with RabbitMQ has been added.
|
Tip
|
Using the CLI
Use the CLI to quickly create a RabbitMQ application. mn create-app hellorabbit --features rabbitmq |
See the Micronaut RabbitMQ documentation for more information.
GraphQL Support
Support for creating GraphQL + Micronaut applications has been added.
See the Micronaut GraphQL documentation for more information.
Compile Time Bean Introspection
A compilation time replacement for jdk:java.beans.Introspector[] has been added which allows introspecting and creating bean instances without using reflection, improving performance, memory consumption and GraalVM support.
See the new section on Bean Introspection for more information.
Cold Start and Performance Improvements
Micronaut 1.1 cold start performance has been improved through a variety of optimizations including compilation time indexing of common bean types. Users should see superior cold start performance for both Microservices and Functions.
AWS API Gateway Proxy Support
Support for AWS API Gateway Proxy has been added allowing AWS Lambda’s to be defined as regular controllers. See the documentation on AWS API Gateway Proxy Support for more information and links to examples.
|
Tip
|
Using the CLI
$ mn create-app my-app --features aws-api-gateway |
GraalVM Native Improvements
Support for GraalVM Substrate (nativeimage) has been improved in a number of different ways.
-
Framework Improvements - Framework level dynamic classloading and reflection has been completely removed thus making it easier to get applications running on GraalVM
nativeimageand reducing the number of customizations necessary. -
Build Time Reflection Data - Thanks to the aforementioned feature, the older
GraalClassLoadingAnalyzerruntime step has been removed and replaced by build time generation ofreflection-config.jsonfor classes that do require it (typically third party libraries). -
Simplified Image Generation - You can now generate a native image with just
native-image --class-path myjar.jarwithout any additional flags. Since Micronaut now computes the appropriate GraalVM configuration at compilation time.
Google Cloud Platform (GCP) Support
A new Google Cloud Configuration is available that adds general support for GCP and integration with Stackdriver Trace for distributed tracing.
AWS Lambda Custom Runtime + GraalVM Support
Support for creating AWS API Gateway applications (see above) that are compiled into GraalVM native images and run using an AWS Lambda Custom Runtime has been added. This reduces cold starts on Lambda to 100-200ms.
|
Tip
|
Using the CLI
$ mn create-app my-app --features aws-api-gateway-graal |
AWS Lambda Alexa Skill Support
Support for creating Alexa Skills with Micronaut has been added.
|
Tip
|
Using the CLI
You can create Alexa functions with the CLI. Use the $ mn create-function hello-alexa --provider alexa |
Micronaut Test Templates
The CLI has been updated to generate tests that use Micronaut Test for JUnit 5 and Spock.
Micrometer 1.1 and @Timed Support
Micrometer has been upgraded to 1.1 and support for @Timed AOP advice added.
|
Tip
|
Using the CLI
$ mn create-app my-app --features micrometer |
Kafka 2.1 and Kafka Improvements
Kafka support has been improved with the release of Micronaut Kafka 1.1 including supports for metrics, distributed tracing and Kafka 2.1.
API Versioning Support
API versioning is now supported. See the API Versioning documentation for more information on how to use this feature. Thanks for Bogdan Oros for contributing this feature.
Jackson @JsonView Support
Support for using @JsonView on controller methods has been added can be optionally enabled by setting jackson.json-view.enabled to true in application.yml. Thanks to Mark Mindenhall for contributing this feature.
Support for Spring Cloud Config Server
If you are already using Spring Config Server then Micronaut now features native integration for distributed configuration.
See the Documentation on Distributed Configuration with Spring Cloud Config for more information.
Thanks to Thiago Locatelli and Michel Schudel for contributing this feature.
Refactoring of File Responses
In an effort to make a more consistent and understandable API, some methods and classes related to sending file responses have been deprecated. api:http.server.types.files.SystemFile[] is the replacement for api:http.server.types.files.AttachedFile[] and the constructors of api:http.server.types.files.StreamedFile[] have been deprecated in favor of new constructors that better convey the intended functionality.
Note that api:http.server.types.files.SystemFile[] behaves differently from api:http.server.types.files.AttachedFile[] in that responses are by default sent inline instead of attached. In addition, support for sending attached responses has been added to api:http.server.types.files.StreamedFile[]. The following methods can be used to attach a system or streamed file.
-
api:http.server.types.files.StreamedFile#attach-java.lang.String-[StreamedFile#attach(String)]
-
api:http.server.types.files.SystemFile#attach--[SystemFile#attach()]
-
api:http.server.types.files.SystemFile#attach-java.lang.String-[SystemFile#attach(String)]
Support for Freemarker Views
Support for rendering Freemarker Views has been added. Thanks to Jeronimo López for contributing this feature.
Constraint Bean Support
For those using the micronaut-hibernate-validator configuration, constraints will now be attempted to be retrieved from the bean context. This means you can now use dependency injection in your custom constraints.
Support for JCache Caching
Support has been added for the JCache specification. If you define a javax.cache.CacheManager bean it will be used for caching. For example:
snippet::io.micronaut.docs.whatsNew.CacheFactory[tags="imports,class"]
Support for JAsync SQL
Support for JAsync SQL has been added, which includes non-blocking drivers for both Postgres and MySQL. Thanks to Ohad Shai for contributing this feature.
Major Improvements for Multipart File Uploads
Several issues and improvements have been made in regards to file uploads in comparison to the previous version of Micronaut. These fixes have been substantial enough that they have caused the behavior of uploads to change, however these changes should not break any existing use cases. To summarize the issues:
-
Routes were not in control of the flow of bytes coming from the client with multipart uploads
-
It was not possible to read and release a chunk of data at a time. The entire upload would be put into memory or disk
-
Mixed (memory/disk with a threshold) uploads are not supported
The following changes have been implemented:
-
Routes gain control of the data flow as soon as they are executed. A route cannot be executed until all of its arguments are fulfilled, so data will reside on memory or disk until the route can be executed.
-
After processing a chunk of data it is immediately released. For memory uploads this means the data is immediately freed. For disk uploads the data remains on disk until after processing.
-
Two new configuration options are available to support mixed uploads:
micronaut.server.multipart.mixedandmicronaut.server.multipart.threshold. When data needs to be buffered, mixed uploads will initially store data in memory. Once the threshold is reached, the data will be erased from memory and moved entirely onto disk.
Option to Disable Environment Detection
Environment detection can be disabled through a method on the application context builder, system property, or environment variable.
See the Environment documentation for more information.
JWK and JWK Set support
You can expose an endpoint with a JWK Set thanks to the Keys Controller.
You can also make a remote JWKS participate in a JWT signature validation. Read the Validation with remote JWKS section to learn more.
Dependency Upgrades
-
Groovy
2.5.4→2.5.6 -
Gradle
4.10.2→5.1.1(CLI Only) -
Kafka
2.0.1→2.1.1 -
Micrometer
1.0.6→1.1.4 -
Reactive Streams
1.0.1→1.0.2 -
Jackson
2.9.7→2.9.8 -
Nimbus JOSE+JWT
6.0.2→6.8 -
Spring
5.0.10.RELEASE→5.1.4.RELEASE -
Reactor
3.2.0.RELEASE→3.2.5.RELEASE -
RxJava 2
2.2.2→2.2.6 -
Reactive Postgres
0.10.5→0.11.3 -
GORM
6.1.8.RELEASE→7.0.0.RELEASE -
Hibernate
5.3.7.Final→5.4.0.Final -
Hikari
2.7.9→3.3.1 -
Commons DBCP 2
2.1.1→2.6.0 -
Tomcat Pool
9.0.1→9.0.17 -
Neo4j Java Driver
1.6.4→1.7.2 -
Mongo Java Driver
3.8.0→3.10.0 -
Mongo Reactive Driver
1.8.0→1.10.0 -
Redis Lettuce Driver
5.0.4.RELEASE→5.1.3.RELEASE -
Jaeger
0.31.0→0.33.1 -
Zipkin Reporter
2.7.9→2.8.0 -
Brave Instrumentation HTTP
5.4.2→5.6.1 -
Brave Opentracing →
0.33.3→0.33.10
1.1.0 Breaking Changes
The following changes could potentially be considered to be breaking changes, however the likelihood of any negative impact is low.
-
HttpSessionConfiguration default value for
cookiePathis/. The change was necessary for cookies to function normally. -
The AccessRefreshToken API has been changed to include
tokenTypeandexpiresIn. This change was necessary to comply with the token response RFC 6749. -
Route binding behavior for a request argument with a generic type has changed. For routes that take in an
HttpRequest<SomeType>, anUnsatisfiedRouteExceptionwill be thrown if no body is found in the request. To restore the previous behavior, remove the generic type from the argument.
public String hello(HttpRequest<Author> request) //requires the body to be present
public String hello(HttpRequest request) //the body will not be read (same as 1.0.x)</code></pre>
Micronaut Framework 1.0.0
What’s new with 1.0.0
Modularization
Micronaut is now modular, with parts of Micronaut being shifted into subprojects. See the following links for new subprojects that now have independent release cycles outside of Micronaut core:
GraalVM 1.0 RC11 Support
The GraalVM support has been updated to accommodate the latest changes in GraalVM 1.0.0 RC11.
Dependency Upgrades
-
Kafka
2.0.0→2.0.1 -
Reactive Streams
1.0.1→1.0.2 -
Jackson
2.9.7→2.9.8
1.0.0 Breaking Changes
1.0.0.RC3
-
All Micronaut modules have been renamed to include
micronaut-prefix to make it easier to manage dependencies. If you are upgrading rename all references modules. Examplebom→micronaut-bom,inject→micronaut-injectetc. -
Methods for JWT signature generation have been removed from RSASignatureConfiguration or ECSignatureConfiguration. Those beans should be used in microservices where you need only signature verification and not generation.
To enable a RSA or EC JWT signature generation, you need to have in your app a bean of type RSASignatureGeneratorConfiguration or ECSignatureGeneratorConfiguration.
1.0.0.RC2
-
io.micronaut.security.authentication.Authenticator::authenticatemethod signature has changed from:
public Publisher<AuthenticationResponse> authenticate(UsernamePasswordCredentials credentials)
to:
public Publisher<AuthenticationResponse> authenticate(AuthenticationRequest authenticationRequest)
1.0.0.RC1
-
The default port if no port is specified is now port 8080 instead of a random port, except in the test environment. A random port can be obtained by setting the port to -1.
-
The configuration for static resource has been changed to allow multiple mappings, each with their own set of paths. This will allow accessing resources at multiple URLs. Previously the configuration might have looked like:
micronaut: router: static: resources: enabled: true mapping: /static/** paths: - classpath:staticAnd now the equivalent configuration would be:
micronaut: router: static-resources: default: enabled: true mapping: /static/** paths: - classpath:staticThe word
defaultin that example is arbitrary and can be replaced with any name that is appropriate to describe the category of resources that will be served.NoteNotice the change from static.resourcestostatic-resources. -
The CLI feature for Netflix Archaius was incorrectly named
netflix-archius. The feature has now been renamed to reflect the correct name,netflix-archaius. -
The intercept url map security rule now no longer considers the query part of the request when determining if the request matches. Previously
/?value=truewould not match/. -
Several APIs surrounding route URI matching and template parsing have changed to allow more information to be retrieved from the parsing process.
-
The following packages have been renamed:
io.micronaut.http.server.binding -> io.micronaut.http.bind
-
The following annotations have been moved to new locations:
io.micronaut.http.client.Client -> io.micronaut.http.client.annotation.Client io.micronaut.security.Secured -> io.micronaut.security.annotation.Secured
-
The jackson deserialization features ACCEPT_SINGLE_VALUE_AS_ARRAY and UNWRAP_SINGLE_VALUE_ARRAYS are now enabled by default. To revert to the previous behavior, see the section on Jackson Configuration for information on how to customize deserialization features.
1.0.0.M4
-
Libraries compiled against earlier versions of Micronaut are not binary compatible with this release.
-
The Java module names generated in previous versions were invalid because they contained a
-. Module names with dashes were converted to an underscore. For example:io.micronaut.inject-java→io.micronaut.inject_java. -
The annotation metadata API has been changed to no longer use reflective proxies for annotations. The methods that used to return the proxies now return an
AnnotationValuethat contains all of the data that existed in the proxy. The methods to create the proxies now exist undersynthesize... -
Many classes no longer implement
AnnotatedElement. -
AnnotationUtilhas seen significant changes and is now marked as an internal class. -
BeanContext.getBeanRegistrationshas been renamed toBeanContext.getActiveBeanRegistrations. -
Endpoint annotations have moved packages:
io.micronaut.management.endpoint→io.micronaut.management.endpoint.annotation. -
Endpoint method arguments were previously included in the route URI by default. Now endpoint arguments are not included in the route URI by default. An annotation,
@Selectorhas been added to indicate an endpoint argument should be included in the URI. -
The
@Controllerannotation now requires a value. Previously a convention was used to determine the URI. -
The
HttpMethodMappingannotations (@Get,@Put, etc) have changed their default behavior. They no longer use a convention based off the method name if the URI was not provided. The URI is still not required, however it now defaults to/. The new default means the method will be accessible from the controller URI.
1.0.0.M3
-
The contract for
io.micronaut.http.codec.MediaTypeCodechas changed to support multiple media types. -
To reduce confusion around
@Parameter, it can no longer be used to denote an argument should be bound from the request url. Its sole purpose is defining arguments for parameterized beans. Use@QueryValueinstead. -
The health endpoint will now only report details when the user is authenticated. To revert to the previous behavior, set
endpoints.health.detailsVisible: ANONYMOUS. -
The CLI options have been standardized to use two leading dashes for long options (like
--stacktrace) and one for shortcuts (like-h). That means that some options no longer work. For example, this command used to work with M2:create-app -lang groovy myapp. From M3, you will see this error:Could not convert 'ang' to SupportedLanguage for option '--lang'. Specifying either-l LANGor--lang LANGworks as expected. -
The following packages have been renamed:
-
io.micronaut.configurations.ribbon→io.micronaut.configuration.ribbon -
io.micronaut.configurations.hystrix→io.micronaut.configuration.hystrix -
io.micronaut.configurations.aws→io.micronaut.configuration.aws -
io.micronaut.http.netty.buffer→io.micronaut.buffer.netty
-
-
The default Consul configuration prefix has been changed to reflect changes in the latest version of Consul. Previously a leading slash was expected and the default value was
/config/. The new default value isconfig/. To restore the previous behavior, setconsul.client.config.path = /config/ -
The
sessionmodule will now serialize POJOs to JSON using Jackson by default instead of Java Serialization. This change is because Java serialization will be removed and deprecated in a future version of the JDK.
1.0.0.M2
-
The constructor signature for DefaultHttpClient has changed to include an extra argument. This change should not impact existing uses.
-
Libraries compiled against M1 are not binary compatible with M2.
-
For Java 9+ automatic module name has been set to
<groupId>.<name>. Previously if you have been using the "inject-java" module, the module is now named "io.micronaut.inject-java". -
When an HttpClientResponseException is thrown, the body of the response will be set to the exception message for responses with a text media type. Previously the status description was returned.
-
Mongo configurations were updated to a new version of the driver (3.6.1 → 3.7.1), which may break existing uses. See their upgrading page for more information.
-
The
routerconfiguration key was changed to bemicronaut.router. Static resource configuration is affected by this change. Please update your configuration:router.static.resources→micronaut.router.static.resources.