HiddenHttpMethodFilter can be problematic as it causes early
consumption of a request body if the body may contain parameters. This
happens as the filter needs to read the parameters to see if an
_method parameter is present. The filter is only beneficial for web
applications that are the hidden HTTP method functionality but is
potentially detriimental to all applications that are not. As such
we no longer believe that it should be enabled by default and users
should be required to opt in.
Closes gh-16953
Previously, if a user defined a MongoDbFactory bean but did not define
a client bean, MongoDataAutoConfiguration would back off leaving the
context without a MongoTemplate, etc.
This commit reworks the auto-configuration so that only the
auto-configuration of a MongoDbFactory is dependent on the existence
of a Mongo client bean. Auto-configuration of the other components
that depend on a MongoDbFactory will now continue in the absence of a
Mongo client bean.
Closes gh-17416
Apply checkstyle rule to ensure that private and package private
classes do not have unnecessary public methods. Test classes have
also been unified as much as possible to use default scoped
inner-classes.
Closes gh-7316
spring-kafka.2.3.0.M3 introduced a new property `RecordInterceptor` to
the container factory.
Auto-configure the property if a single instance is present.
See gh-17322
`@EmbeddedKafka` now supports JUnit 5 without the need for a Spring
test application context. Remove the previous workaround that replaced
the JUnit4 `@ClassRule` and use `TopicBuilder` to build the
topic bean.
See gh-17355
This commit removes the now outdated `HibernateEntityManagerCondition`
in favour of a simple check of `SessionImplementor`. As of
Hibernate 5.2, a single `hibernate-core` jar is required so a single
class check is enough.
Closes gh-17288
This commit removes the now outdated `HibernateEntityManagerCondition`
in favour of a simple check of `SessionImplementor`. As of
Hibernate 5.2, a single `hibernate-core` jar is required so a single
class check is enough.
Closes gh-17283
Spring Framework recently removed the `MessageHandlerAcceptor` (which is
a sub-class of `RSocketMessageHandler`).
Instead of implementing directly the `SocketAcceptor` contract, it now
exposes them through `clientAcceptor()` and `serverAcceptor()` methods.
See gh-17280
Update `NettyWebServerFactoryCustomizer` to deal with the fact that
Netty treats `0` and negative connection timeout values differently to
Tomcat, Undertow and Jetty.
See gh-16535
Both Flyway and Liquibase makes use of DataSourceProperties to get
default properties. Previously, both used strictly the configuration
properties and failed to consider embedded datasource properties
autoconfigured by @AutoConfigureTestDatabase. In case a database layer
test e.g. @JdbcTest relies on the autoconfigured embedded datasource,
Flyway and Liquibase autoconfiguration fails as they are not aware of
the embedded datasource properties.
See gh-16814
Deprecate the existing `BindResult.orElseCreate` method in favor of
`bindOrCreate` methods on the `Binder`. These new methods allow us to
implement custom creation logic depending on the type of object being
bound. Specifically, it allows constructor based binding to create new
instances that respect the `@DefaultValue` annotations.
Closes gh-17098
Co-authored-by: Phillip Webb <pwebb@pivotal.io>
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
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
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
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
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
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
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
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
This commit auto-configures CBOR (see https://cbor.io/) codecs in the
RSocketStrategies, using Jackson binary format support.
The required dependency is added to the rsocket starter. Binary codecs
are well suited for RSocket payloads, so this codec is added first to
the list of codecs (before the JSON one already supported).
Closes gh-16830
This commit auto-configures a prototype `RSocketRequester.Builder` bean
for building requester instances. This builder is pre-configured with
auto-detected `RSocketStrategies` (same as the server side).
Closes gh-16280
Before this change it got overwritten by forwarding an empty
CacheControl to Spring. Spring itself sets CacheSeconds already
correctly in absence (=null) of a CacheControl.
Also:
* Fixes bug in WebMvcAutoConfigurationTests.cachePeriod which
prevented it to assert anything
See gh-16488
Closes gh-16730
Previously, due to a quirk in Spring Framework, it was necessary to use bean method
proxying in @Configuration classes that define one or more FactoryBeans. This quirk has
now been addressed so this commit disables bean method proxying where it is now no longer
needed.
Closes gh-16533
Since Hazlecast 3.12, YAML configuration format is supported in
addition to XML. Therefore, this change makes Spring Boot automatically
discover not only `hazelcast.xml` (and `hazelcast-client.xml`), but also
`hazelcast.yaml` (and `hazelcast-client.yaml`).
See gh-16632
Spring Session's own configuration support (i.e.
SpringHttpSessionConfiguration) will configure the default
DefaultCookieSerializer with rememberMeRequestAttribute if
SpringSessionRememberMeServices bean has been detected in the
application context.
In contrast, Spring Boot's auto-configured DefaultCookieSerializer does
not do this which results in a different out-of-the-box experience for
users that rely on Spring Session's remember-me integration.
This commit improves Spring Session DefaultCookieSerializer
auto-configuration to match Spring Session's behavior and make the
auto-configured DefaultCookieSerializer aware of
SpringSessionRememberMeServices bean.
See gh-16513
This commit adds support for configuring Undertow's server options that were previously
not configurable via application properties. The additions are the following:
- allow-encoded-slash
- always-set-keep-alive
- decode-url
- max-cookies
- max-headers
- max-parameters,
- url-charset
See gh-16278
As of Spring Data Moore, the Elasticsearch high level REST client is
supported for Spring Data repositories. The transport client is now
deprecated and is likely to be removed in a future Spring Data release.
This commit deprecates the transport client and marks all the associated
configuration properties as deprecated. The Spring Boot starter depends
on the `spring-data-elasticsearch` project, which now depends on both
transport client and high level REST client.
This commit also deprecates the Jest client, as Spring Boot will focus
on supporting the high level REST client and the reactive client
provided by Spring Data - both being in sync with the fast release pace
of Elasticsearch.
Closes gh-15008
Previously, if the `server.use-forward-headers` property
was set to true, X-Forwarded-* headers support was provided
at the server level. The property has been deprecated in favor
of `server.forward-headers-strategy` which can be also be configured
to use Spring's forwarded header support apart from native server support.
Closes gh-5677
This commit adds support for RSocket server applications.
The auto-configuration will either add RSocket support to an existing
Reactor Netty server in a WebFlux application (as a WebSocket endpoint),
or bootstrap a brand new RSocket server instance.
Spring Boot will also auto-configure the Spring Messaging infrastructure
that supports Controller beans with `@MessageMapping` annotated methods.
Fixes gh-16021
This commit migrates `AnnotationConfigReactiveWebApplicationContext`
parent to the `GenericApplicationContext` abstraction. Any use of
`AnnotationConfigWebApplicationContext` is also removed as it also
inherits from the `AbstractRefreshableApplicationContext` outdated
hierarchy.
A new `AnnotationConfigServletWebApplicationContext` context is
introduced instead, extending from `GenericApplicationContext` and
providing the counter part of the reactive context for the Servlet-based
web app tests.
See gh-16096
This commit applies changes similar to what's been done in gh-9068, for
MVC and WebFlux configurations. This is now possible thanks to the
changes done in Spring Framework in
https://github.com/spring-projects/spring-framework/pull/22596
Fixes gh-16427
This commit adds an extra check for the presence of thymeleaf-spring5
library on the classpath. ThymeleafAutoConfiguration is now only
considered if both thymeleaf-spring5 and thymeleaf jars are present.
Closes gh-16341