Upgrade to Micrometer 1.0.0-rc.3 and refactor existing
auto-configuration to align with updated APIs.
Note that Spring MVC instrumentation has now changed from an interceptor
to a Filter.
See gh-10906
Refactor `ReactiveWebApplicationContext` implementations to align closer
with the `WebApplicationContext` implementations defined in
Spring Framework.
The following classes are now provided:
- `AnnotationConfigReactiveWebApplicationContext` -- A refreshable
reactive web context with support for `@Configuration` classes.
- `GenericReactiveWebApplicationContext` -- A non-refreshable reactive
GenericApplicationContext.
- `ReactiveWebServerApplicationContext` -- A non-refreshable reactive
GenericApplicationContext with support for server discovery.
- `AnnotationConfigReactiveWebServerApplicationContext` -- A
non-refreshable reactive `GenericApplicationContext` with support
for `@Configuration` classes and server discovery.
These classes roughly align to the following Servlet equivalents:
- `AnnotationConfigWebApplicationContext` (Spring Framework)
- `GenericWebApplicationContext` (Spring Framework)
- `ServletWebServerApplicationContext` (Spring Boot)
- `AnnotationConfigServletWebServerApplicationContext` (Spring Boot)
An additional `ConfigurableReactiveWebEnvironment` interface as also
been introduced, primarily for `@ConditionalOnWebApplication` to use.
Fixes gh-10852
This commit ensures that all errors handled by the
`DefaultErrorWebExceptionHandler` (Spring WebFlux error convetion
support) logs an error with request information and exception
stacktrace.
This is limited to errors that result in an HTTP 5xx error.
Exceptions that extend `ResponseStatusException` and set a non-5xx
status will not be logged.
Closes gh-10904
This commit enables HTTP/2 support for Tomcat and Undertow, for both
Servlet-based and Reactive applications.
Enabling the `server.http2.enabled` configuration flag is enough with
Undertow.
Tomcat has a few prerequisites:
* Tomcat 8.5 requires JDK8+ and the proper libtcnative version installed
on the host
* Tomcat 9.0.x requires JDK9+
Closes gh-10043
This commit adds a new configuration properties class for configuring
HTTP/2 protocol support.
By default, this protocol is disabled as enabling it requires several
manual changes:
* configuring a web server for proper TLS and ALPN support
* configuring a proper SSL certificate
See gh-10043
This commits adds the AprLifecycleListener as a default
LifecycleListener in order to detect and use automatically the
tomcatnative library if it is available, for SSL support.
This feature can be useful for both performance reasons or for
supporting ALPN when using JDK8.
See gh-10043
Closes gh-9964
Remove extraneous white space and adjusted the length of non-code lines
to be as close to 90 characters (but not over 90 characters) as
possible.
Update a couple things I missed in the editing pass, too.
Closes gh-10897
Remove extraneous white space and adjusted the length of non-code lines
to be as close to 90 characters (but not over 90 characters) as
possible.
Update a couple things I missed in the editing pass, too.
Closes gh-10896
Remove extraneous white space and adjusted the length of non-code lines
to be as close to 90 characters (but not over 90 characters) as
possible.
Update a couple things I missed in the editing pass, too.
Closes gh-10893
Remove extraneous white space and adjusted the length of non-code lines
to be as close to 90 characters (but not over 90 characters) as
possible.
Update a couple things I missed in the editing pass, too.
Closes gh-10892
Provide a `getEnvironment` method in `SpringBootContextLoader` to allow
specialized `ConfigurableEnvironment` implementations to be used.
Closes gh-10740
Update the logback file appender to use `SizeAndTimeBasedRollingPolicy`
rather than `FixedWindowRollingPolicy`.
Add two new properties to improve log file configuration capabilities:
- `logging.file.max-history` to limit the number of archive log files
to keep.
- `logging.file.max-size` to limit the log file size.
See gh-6352
Flyway implicitly adds classpath: to locations without a prefix but
resource loader fails to find migratons on the classpath without the
prefix.
Add an explicit classpath: prefix so that both Flyway and the resource
loader used to check the locations can find the migration location.
See gh-10807
Previously, spring.config.name was handled in such a way that its
value would replace the defaults. By constrast, spring.config.location
would add to the defaults.
Update the handling of spring.config.location so that it replaces the
defaults. This aligns its behaviour with spring.config.name. To allow
users to add additional locations a new property,
spring.config.additional-location, has been introduced. It behaves as
spring.config.location did prior to this change.
Closes gh-10595
The Gradle plugin integration tests find their Gradle build scripts
using a naming convention of ${ClassName}-${methodName}.gradle. This
convention led to two gradle scripts with filenames that were long
enough to causes problems on Windows.
This commit renames two test methods to reduce the length of their
names and, therefore, the names of their corresponding Gradle script
files.
Closes gh-10868
Clean `${revision}` variables when running invoker based integration
tests. Prior to this commit some `${revision}` placeholders remained
in the invoker local repository preventing the project from being built
outside of the reactor.
Fixes gh-10667
Move logic from `ParameterNameMapper` into `ReflectiveOperationInvoker`
in order to reduce the surface area of the public API.
Also rename some classes for consistency.
Instead of looking for the presence of `WebSecurityConfiguration`,
this commit checks for the presence of a `Filter` with the name
springSecurityFilterChain. This allows users to configure the Filter
without adding `WebSecurityConfiguration`, making it more flexible.
`springSecurityFilterChain` is somewhat of a contract in Spring Security
and it relies on the name being `springSecurityFilterChain`.
Closes gh-10849
This commit automatically instruments all available data sources with
a configurable metric name. The instrumentation can be disabled in case
more control is needed.
Closes gh-10295
Previously, the configuration metadata annotation processor relied
upon an additional metadata file have been copied to an output
location. When building with Gradle, it's the processResources task
that performs this copy and there is no guarantee that it will have
run before the compileJava task unless an explicit dependency betwee
the two tasks has been configured. If a project is built using
Gradle's parallel build support, the likelihood of this required
ordering not occurring increases.
This commit updates the configuration metadata annotation processor to
consider a new annotation processor option when looking for the
additional config metadata file. The Gradle plugin has been updated
to provide this option as a compiler argument. The option is only
provided when the annotation processor is found on the compilation
classpath to avoid a warning from javac's annotation processing about
the use of an option that is not supported by any of the available
annotation processors.
Closes gh-9755
This commit adds a new customizer interface, `NettyServerCustomizer` for
customizing Reactor Netty server instances while they're being built.
Closes gh-10418
Exceptions inside AbstractReactiveHealthIndicator.doHealthCheck()
method, outside of Mono pipeline, could fail whole endpoint
response instead of returning `DOWN` status from indicator.
See gh-10822
This commit updates `WebFluxSecurityConfiguration` to look for a
`WebFilterChainProxy` rather than the default configuration that
`@EnableWebFluxSecurity` triggers. The latter is now package private.
Previously, ConfigurationPropertiesBindingPostProcessor had a number
of setter methods that implied that its configuration was more mutable
than it actually is and would only have an effect when called early
on in the post-processor's lifecycle.
This commit clarifies how the post-processor can be configured by
removing the misleading setters.
Closes gh-10598
Previously, configuration properties binding would only see changes to
the environment if there was no PropertySourcesPlaceholderConfigurer
in the context. This happened because
PropertySourcesPlaceholderConfigurer wrapped the Environment in a
PropertySource, effectively hiding it from the change tracking
performed by SpringConfigurationPropertySources.
This commit updates ConfigurationPropertiesBindingPostProcessor so
that it ignores the environment property source contained by
PropertySourcesPlaceholderConfigurer and uses a composite of
the PropertySourcesPlaceholderConfigurer's other property sources and
the Environment's PropertySources instead.
Since Kotlin extensions do not apply to static
methods, this commit introduces a runApplication()
Kotlin top level function that acts as a Kotlin
shortcut for SpringApplication.run().
This shortcut avoids to require using non-idiomatic
code like SpringApplication.run(FooApplication::class.java)
and provides a runApplication<FooApplication>() alternative
(as well as an array of KClass based alternative when
multiple classes need to be passed as parameter).
It is possible to customize the application with the
following syntax:
runApplication<FooApplication>() {
setEnvironment(environment)
}
See gh-10511
This commit adds Kotlin main artifacts to Spring
Boot dependency management and will be replaced by
Kotlin BOM when it will be available (see KT-18398).
See gh-9486
This commit renames spring.datasource.initialize to
spring.datasource.initialization-mode and use the
DataSourceInitializationMode enum. By default, only an embedded
datasource is initialized.
Closes gh-10773
This commit introduces a endpoints.<id>.web.path generic property that
allows to customize the path of an endpoint. By default the path is the
same as the id of the endpoint.
Such customization does not apply for the CloudFoundry specific
endpoints.
Closes gh-10181
This commit makes sure that the `replyTemplate` is set if a
KafkaTemplate is available in the context which effectively add support
for `@SendTo`.
Closes gh-10669