Using the throwOnFailure attribute on the tomcat connector, we can now
determine if the underlying exception was a BindException and throw
a PortInUseException instead of the generic WebServerException.
Closes gh-7130
Update `WebMvcAutoConfiguration` and `WebFluxAutoConfiguration` so that
`Printer<T>` and `Parser<T>` beans are automatically registered with
the conversion service.
Prior to this commit only `GenericConverter`, `Converter` and
`Formatter` beans were automatically registered.
See gh-17064
Since the move to JUnit 5, a number of tests were failing on Windows.
The majority were failing due to open file handles preventing the
clean up of the tests' temporary directory. This commit addresses
these failures by updating the tests to close JarFiles, InputStreams,
OutputStreams etc.
A change has also been made to CachingOperationInvokerTests to make
a flakey test more robust. Due to System.currentTimeMillis() being
less precise on Windows than it is on *nix platforms, the test could
fail as it would not sleep for long enough for the TTL period to have
expired.
Add a new property to `RedisSessionProperties` that allows the default
`ConfigureRedisAction` to be changed. Users can still also configure
the action using a `@Bean`.
See gh-17022
Broaden the scope of customizer support so that instead of focusing
just on headers, we can now customize any outgoing `HttpClientRequest`.
Also update auto-configuration to automatically add any
`RestTemplateRequestCustomizer` beans to the builder.
See gh-17091
Update `RestTemplateBuilder` so that it is easier to apply custom
headers to the outgoing request. The update is particularly useful
for setting the `User-Agent` header, for example so that a GitHub
username can be used when calling `api.github.com`.
See gh-17091
This commit changes the default file extension for Freemarker templates
from `*.ftl` to `*.ftlh`. This commit also enables by default the
Freemarker setting `"recognize_standard_file_extensions"` to ensure that
HTML escaping is performed by default in Spring Boot applications.
Applications should adapt to this change by changing the file extensions
of existing templates to `.ftlh`.
Closes gh-15131
Update `ConfigFileApplicationListener` so that property filtering works
against the original `PropertySource`, rather than the underling `Map`.
Prior to this commit, it was impossible for a `CompositePropertySource`
to be used as the `defaultPropertySource`.
Closes gh-17011
This commit configures a `PathPatternRouteMatcher` in the RSocket
support if spring-web is on the classpath. This `RouteMatcher`
implementation is more efficient than the `SimpleRouteMatcher`, which is
based on the `AntPathMatcher`.
Closes gh-16865
As of Spring Data Moore, a new reactive template and the
corresponding repositories support have been added.
This commit auto-configures a `ReactiveElasticsearchTemplate`
with the configuration properties under the
`spring.data.elasticsearch.client.reactive` namespace.
To enable this feature, applications require both Spring Data
Elasticsearch dependencies (typically
`spring-boot-starter-data-elasticsearch`) and dependencies
for a `WebClient` (often `spring-boot-starter-webflux`).
The support for the reactive Elasticsearch repositories is
also provided.
Closes gh-16214
This commit auto-configures the Elasticsearch REST client support
as a template for Spring Data Elasticsearch. As of this commit,
using the transport client is still possible but developers
should migrate.
This commit also removes the deprecated annotation on the
Elasticsearch auto-configuration for the transport client, since
this deprecation notice is already present on the configuration
property.
Closes gh-17024
Closes gh-16542
Reduce the surface area of the public API by making the
`BasicAuthentication` and `BasicAuthenticationClientHttpRequestFactory`
class package private.
This commit also attempts to simplify `TestRestTemplate` by keeping
the `RestTemplateBuilder` and reusing it, rather than needing to deal
only with a `RestTemplate` instance.
See gh-17010
Update `RestTemplateBuilder` to use a custom request factory to add
authentication headers rather than an interceptor.
Prior to this commit, the use of the `BasicAuthenticationInterceptor`
interceptor could cause `OutOfMemoryError` whenever a large file is
uploaded.
See gh-17010
Split the JUnit 5 `OutputCapture` class into separate `OutputExtension`
and `CapturedOutput` classes. The JUnit 5 callback methods are now
contained only in the `OutputExtension` class so no longer pollute the
public API that users will interact with.
The `CapturedOutput` class has also been updated to capture System.err
and System.out separately to allow distinct assertions if required.
Closes gh-17029
Refactor `Autotime` from a properties object to an interface and
change the existing metric recording implementations. The `AutoTimer`
interface is a general purpose callback that can be applied to a
`Timer.Builder` to configure it. Autotime properties are now located
in `spring-boot-actuator-autoconfigure` and have become an
implementation of the interface.
Closes gh-17026
Update `SpringIterableConfigurationPropertySource` so that they cache
and cache key are not stored in different fields. Prior to this commit
it was possible that the an incorrect cache could be returned from
because the key and cache were out of sync.
This commit also allows more lenient handling of ConcurrentModification
exceptions if they are thrown during cache retrieval.
Closes gh-17017
See gh-17013
Update `TomcatWebServer` so that lifecycle exceptions are silently
swallowed when attempting shutdown. Prior to this commit it was
possible that a Tomcat instance might not be properly destroyed and
could leave non daemon threads running, which prevent the JVM from
exiting.
Fixes gh-16892
Update Spring Session auto-configuration to ensure that the
`DefaultCookieSerializer` doesn't break when Spring Security is not
present on the classpath.
Closes gh-16889
Update `JavaBeanBinder` so that the `isOfDifferentType` method checks
both the actual type and the resolved type. Prior to this commit, it
was possible that when `canCallGetValue` is `true` the `resolvedType`
could be different from `type.resolve`.
Closes gh-16974
Previously, configuration property constructor binding relied on compilation
with -parameters to be able to discover the names of a constructor's
parameters, failing silently if the parameter names were not available. This
commit updates it to fail when the names could not be determined and switches
to using DefaultParameterNamesDiscoverer. This align configuration property
constructor binding with actuator endpoint operation invocation.
Closes gh-16928
In the case of a WebFlux + RSocket over websocket setup, the RSocket
auto-configuration would not set up the required routes; only the
websocket endpoint for RSocket would be available, overriding the
handler configured for WebFlux.
This commit introduces `NettyRouteProvider`. Components implementing
that interface can contribute HTTP routes to the Reactor Netty server
being built.
* if none is provided, the regular handler setup is used
* if one or more routes are provided, routes are sorted and added before
the WebFlux handler (acting as a default)
Fixes gh-16826
This commit prevents the `CodecsAutoConfiguration` from being processed
if spring-webflux is not on classpath, since it is only useful for the
WebFlux server infrastructure or `WebClient`.
Closes gh-15690
This commit associates a `ConsumerAwareRebalanceListener` to the
auto-configured listener container factory if a single instance is found
in the context.
See gh-16755
This commit merges the conditions for determining if an endpoint is
available in a single condition, deprecating
`ConditionalOnEnabledEndpoint` in the process.
Closes gh-16169
Update `JavaBeanBinder` so that overloaded setters can be used when
binding. Prior to this commit the setter picked would depend on the
order that the JVM returned the declared methods. We now consistently
prefer using the setter with a parameter type that matches the getter.
Closes gh-16206
Update the auto-configured Jetty `HttpClient` so that a default
`SslContextFactory` is used.
Prior to this commit connecting to https URLs would cause a
`NullPointerException`.
Fixed gh-16810
Update `JavaBeanBinder` so that previously cached beans are compared
using full generic type information. Prior to this commit binding would
fail if a class with the same resolved type, but different generics was
in the cache.
Fixes gh-16821