18.4 Breaking Changes

This section will document breaking changes that may happen during milestone or release candidate releases, as well as major releases eg (1.x.x → 2.x.x).

1.3.0

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_FILES or micronaut.config.files was 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.

1.2.9

  • 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.

1.2.0

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=value in 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 of key=value.

  • The return of reactive types with a generic of Void has been changed from always returning a 404 status to returning a 200, or whatever status is defined in the @Status annotation. This includes CompletionStage, RxJava2, and Reactor types. The change was made to be consistent with the behavior of methods that return void.

  • Extending a @ConfigurationProperties class that contains a @ConfigurationBuilder only 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 the parent.child.address prefix would have been used to configure the address builder on the child class. With this change parent.address will be used.

    1. @ConfigurationProperties("parent")
    2. class Parent {
    3. @ConfigurationBuilder(configurationPrefix = "address")
    4. ...
    5. }
    1. @ConfigurationProperties("child")
    2. class Child extends Parent {
    3. }

1.1.0

The following changes could potentially be considered to be breaking changes, however the likelihood of any negative impact is low.

  • HttpSessionConfiguration default value for cookiePath is /. The change was necessary for cookies to function normally.

  • The AccessRefreshToken API has been changed to include tokenType and expiresIn. 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>, an UnsatisfiedRouteException will be thrown if no body is found in the request. To restore the previous behavior, remove the generic type from the argument.

    1. public String hello(HttpRequest<Author> request) //requires the body to be present
    1. public String hello(HttpRequest request) //the body will not be read (same as 1.0.x)

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. Example bommicronaut-bom, injectmicronaut-inject etc.

  • 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::authenticate method 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:

    1. micronaut:
    2. router:
    3. static:
    4. resources:
    5. enabled: true
    6. mapping: /static/**
    7. paths:
    8. - classpath:static

    And now the equivalent configuration would be:

    1. micronaut:
    2. router:
    3. static-resources:
    4. default:
    5. enabled: true
    6. mapping: /static/**
    7. paths:
    8. - classpath:static

    The word default in that example is arbitrary and can be replaced with any name that is appropriate to describe the category of resources that will be served.

    Notice the change from static.resources to static-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=true would 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:

    1. io.micronaut.http.server.binding -> io.micronaut.http.bind
  • The following annotations have been moved to new locations:

    1. io.micronaut.http.client.Client -> io.micronaut.http.client.annotation.Client
    2. 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-javaio.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 AnnotationValue that contains all of the data that existed in the proxy. The methods to create the proxies now exist under synthesize...

  • Many classes no longer implement AnnotatedElement.

  • AnnotationUtil has seen significant changes and is now marked as an internal class.

  • BeanContext.getBeanRegistrations has been renamed to BeanContext.getActiveBeanRegistrations.

  • Endpoint annotations have moved packages: io.micronaut.management.endpointio.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, @Selector has been added to indicate an endpoint argument should be included in the URI.

  • The @Controller annotation now requires a value. Previously a convention was used to determine the URI.

  • The HttpMethodMapping annotations (@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.MediaTypeCodec has 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 @QueryValue instead.

  • 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 LANG or --lang LANG works as expected.

  • The following packages have been renamed:

    • io.micronaut.configurations.ribbonio.micronaut.configuration.ribbon

    • io.micronaut.configurations.hystrixio.micronaut.configuration.hystrix

    • io.micronaut.configurations.awsio.micronaut.configuration.aws

    • io.micronaut.http.netty.bufferio.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 is config/. To restore the previous behavior, set consul.client.config.path = /config/

  • The session module 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 router configuration key was changed to be micronaut.router. Static resource configuration is affected by this change. Please update your configuration: router.static.resourcesmicronaut.router.static.resources.