Previously, when the liquibase.url, .username, and .password
properties were used to configure a DataSource specifically for
Liquibase that DataSource would never be explicitly closed. As it is
created by DataSourceBuilder with no explicitly configured type it
will use whichever connection pool is available and, therefore, will
create and keep open the pool's minimum number of connections. This
is an unnecessary use of resources both in the application and in the
database.
This commit updates LiquibaseAutoConfiguration so that if it uses
DataSourceBuilder to create a DataSource then it will also close that
DataSource once the database has been migrated.
Closes gh-9218
This commit allows *any* type of `RouterFunction` to be injected in the
WebFlux.fn auto-configuration; previously the `RouterFunction<T>` would
restrict injected beans to a single parameterized type.
Doing requires using the `RouterFunction.andOther` method to collect
them.
Fixes gh-9181
This commit removes the default configuration value previously set
for `spring.thymeleaf.reactive.media-types` since this value overrides
the defaults provided by Thymeleaf.
This value does not drive the default media type used by views, but
rather all media types that the templating engine should support.
Fixes gh-9134
This commit adds a `TomcatWebSocketReactiveWebServerCustomizer`
that customizes the Tomcat context to accept WebSockets connections.
Since reactive servers don't use the JSR 356 for that support,
only Tomcat customization is required for now.
This commit also reorders the server auto-configuration
so that undertow has a chance to be auto-configured before
reactor-netty, which should be a popular dependency thanks to
its HTTP client library.
The existing WebSocket infrastructure for Serlvet based containers
has been moved to a dedicated package and renamed accordingly.
Fixes gh-9113
This commit updates `MapSessionRepository` bean definition return type
and applies equivalent change to `SessionAutoConfigurationTests`.
These changes also ensure compatibility with Spring Session 2.0 which
will merge `ExpiringSession` API with `Session` API.
Closes gh-9145
Move `spring.rabbitmq.listener.*` to `spring.rabbitmq.listener.simple.*`
in preparation for Spring AMQP 2.0 that supports different container
types.
Closes gh-9108
See gh-9055
This commit provides an auto-configuration for reactive Redis and a
starter that provides Lettuce as Jedis doesn't support reactive
operations.
There are no support for reactive redis repositories at the moment so
only a `ReactiveRedisTemplate` is auto-configured if necessary.
Closes gh-8053
Introduce an alternative autoconfiguration if the lettuce Redis driver is
available. Add Lettuce-specific configuration property options
"spring.redis.lettuce.shutdown-timeout" to control the shutdown timeout
of the lettuce driver. Add documentation for the properties, the
supported drivers, and how to switch between drivers.
Split client-specific properties from spring.redis.pool to
spring.redis.jedis.pool and introduce spring.redis.lettuce namespace.
Deprecate spring.redis.pool property.
See gh-5311
Update `DefaultServletWebServerFactoryCustomizerTests` so that the Jetty
access log tests use the default timezone. Prior to this commit it was
possible that running the tests outside of UTC could result in Jetty
throwing a "negative delay" IllegalArgumentException.
See gh-8819
This commit changes the default file extension for Mustache templates,
from `.html` to `.mustache`, which is the file extension used in the
official reference documentation and by most IDE plugins.
Fixes gh-8997
Thymeleaf 3.0 implements the Spring 5.0 view infrastructure for WebMVC
and the new WebFlux framework. This commit adds auto-configuration for
the WebFlux support.
In that process, the configuration property for `spring.thymeleaf` has
been changed to add `spring.thymeleaf.servlet` and
`spring.thymeleaf.reactive` for MVC/WebFlux specific properties.
Now that the `spring-boot-starter-thymeleaf` does not only support
Spring MVC, the transitive dependency on `spring-boot-starter-web` is
removed from it.
Fixes gh-8124
This commit ensures that a primary JSR 303 and Spring Validator will be
exposed if the auto-configuration kicks in. As `LocalValidatorFactoryBean`
exposes 3 contracts (JSR-303 `Validator` and `ValidatorFactory` as well as
the `Spring` validator one), this makes sure that those types can be
injected by type.
`LocalValidatorFactoryBean` exposes 3 contracts and we're only checking
for the absence of a `javax.validation.Validator` to auto-configure a
`LocalValidatorFactoryBean`. If no standard JSR validator exists but a
Spring's `Validator` exists and is primary, we shouldn't flag the
auto-configured one as `@Primary`. Previous iterations on this feature
have made sure that we'll auto-configure at most one
`javax.validation.Validator` so not flagging it `@Primary` is no problem.
This commit also restores and adds tests that validates
`ValidationAutoConfiguration` will configure a JSR validator even if a
Spring Validator is present.
This effectively fixes gh-8495 in a different way.
Closes gh-8979
Closes gh-8976
Remove the `relaxed` attribute from `@ConditionalOnProperty` and instead
rely on the direct configuration property source relaxed name support.
Closes gh-9003
`BasicErrorControllerIntegrationTest` is handling the context in each test
and yet it starts a useless test via `@SpringBootTest`. This commit
removes the useless runner and associated annotations.
Refine Mustache support to provide a cleaner separation between the
reactive and servlet implementations. The views have now moved to the
`spring-boot` project and the auto-configuration has been split into
two distinct `@Imports` to save needing full package declarations.
See gh-8941
This commit simplifies the Mustache support for Spring MVC and removes
the included (view-based) i18n support in favor of more idiomatic
constructs like Mustache lambdas.
Fixes gh-8941
This commit moves the existing Spring MVC Mustache support to its own
`servlet` package and adds a new one under `reactive` for the WebFlux
web applications.
New `MustacheView` and `MustacheViewResolver` types resolve and render
Mustache views for WebFlux applications.
Since this templating engine is now supported by two flavors of Spring
web apps, the `spring-boot-starter-mustache` does not depend anymore on
the `spring-boot-starter-web` one: it's up to the developer to add the
relevant starter `web` or `webflux` to their application.
Fixes gh-8648