This commit makes sure that JMS and Mail JNDI lookups behave the same
way as DataSource JNDI lookups by enabling the "resourceRef" flag.
This will make sure to add "java:comp/env" to the lookup if the JNDI
name doesn't already contain it. If that name does not exist, a second
attempt to the original name will be issued automatically.
Closes gh-12803
This commit adds support for CachingConnectionFactory for both Artemis
and ActiveMQ. If connection pooling is not enabled explicitly, sessions,
producers and consumers are cached. The factory can be further
customized, including reverting to the raw ConnectionFactory, using the
`spring.jms.*` namespace.
Closes gh-12161
This commit expands ActiveMQ's connection pooling to artemis. The same
pooling features are now shared by the two brokers and a
PooledConnectionFactory can be auto-configured when the necessary jar is
present.
Closes gh-13523
Prior to this commit, the `DefaultErrorWebExceptionHandler` would parse
the HTTP "Accept" headers when routing the request to the error handler;
if an error occured during parsing, an `InvalidMediaTypeException` would
be thrown and break the error handling for this request.
This commit ignores those exceptions and makes sure that the error
handling function does not override the response status or the error
itself with those exceptions.
Closes: gh-13372
As of https://jira.spring.io/browse/SPR-16381, Spring Framework now
supports both gzip and Brotli as compression formats for static
resources resolved by the resource chain.
The `GzipResourceResolver` has been deprecated and replaced by the
`EncodedResourceResolver`. This commit uses this new resolver and adapts
the configuration key to reflect those changes.
Note that this resolver is now configured ahead of the
`VersionResourceResolver`.
Closes gh-13242
As of Spring Framework 5.1, we're depending on the Reactor Californium
release train.
Reactor Netty is now at version 0.8 and changed its artifact
coordinates, package names and broke several APIs. Spring Framework is
now up-to-date with those changes and this commit does the same for
Spring Boot.
Note that in that process, the `NettyServerCustomizer` has been changed
since the former `HttpServerOptions.Builder` API is now gone from
Reactor Netty, and we're now relying on immutable server instances
instead of a stateful builder pattern.
See gh-13321
Some Quartz initialization scripts have comments in a different format.
This commit introduces a `comment-prefix` property that should be set by
the user if their target database has a script that contains those
unusual comments.
Closes gh-13041
At present, auto-configuration of `LdapContextSource` is conditional on
presence of a `ContextSource` bean. However, there are valid use cases
which require multiple `ContextSource` bean, for instance
`PooledContextSource`. With the current arrangement, the
auto-configuration of `LdapContextSource` will back off if user provides
a `PooledContextSource` bean, while it would still be reasonable to
reuse the auto-configured `LdapContextSource`.
This commit improves `LdapContextSource` factory method return value and
condition to back off only if users actually provide a
`LdapContextSource` bean themselves.
See gh-13143
Auto-configuration of LDAP's `LdapTemplate` is currently a part of
`LdapDataAutoConfiguration` which is conditional of presence of
`LdapRepository` (i.e. Spring Data LDAP). This arrangement isn't ideal
since the `LdapTemplate` is a part of Spring LDAP project, and therefore
should not be tied to Spring Data LDAP.
This commit improves and simplifies LDAP auto-configuration by moving
`LdapTemplate` configuration to `LdapAutoConfiguration`. Consequently,
`LdapDataAutoConfiguration` is not needed anymore and is removed.
See gh-13136
This commit adds auto-configuration support for both `RestClient` and
`RestHighLevelClient` which are provided by `elasticsearch-rest-client`
and `elasticsearch-rest-high-level-client` dependencies respectively.
`RestClient` is associated with configuration properties in the
`spring.elasticsearch.rest.*` namespace, since this is the component
taking care of HTTP communication with the actual Elasticsearch node.
`RestHighLevelClient` wraps the first one and naturally inherits that
configuration.
Closes gh-12600
This commit removes Hibernate imports from JpaProperties so that it can
be used with another JPA provider.
This commit is a breaking change for an internal, yet public class used
to transmit customizations provided by the user. It does not change the
external functionality though: naming strategies defined as bean are
still taken into account and a customizer has a chance to override it
regardless.
Closes gh-13043
There are documented way to reuse bits of the infrastructure in user
config to offer similar datasource configuration. If that fails, the
regular failure there will kick in.
This commit improves `DataSourceBeanCreationFailureAnalyzer` to not
misguide users that the auto-configuration has failed. Rather, it
describes what has failed in a more generic way.
Closes gh-12947
This commit improves the couchbase auto-configuration so that it is
easier to customize the way the connection to the couchbase server is
initiated.
See gh-11146
Since https://jira.spring.io/browse/SPR-16624, the contract for
`ContentNegotiationStrategy` has been refined and should never return an
empty list if it's got no preference for a media type, but it should
rather respond with a `"*/*"` instead.
This commit fixes the `OptionalPathExtensionContentNegotiationStrategy`
defined in the Spring MVC auto-configuration to have that behavior.
Fixes gh-12900
This commits make sure that the Quartz auto-configuration no longer
associates an `Executor` bean if present in the context as Quartz offers
properties to tune it, which would mutate and lead to unexpected
results.
Closes gh-12823
This commit makes sure that an auto-configuration that requires
`DataSourceProperties` will not break if `DataSourceAutoConfiguration`
has been explicitly excluded.
Closes gh-12512
If two auto-configuration classes with the same name are present,
the conditions report message now uses the fully qualified name for
both instead of the short name.
Fixes gh-11710
Update `AutoConfigurationSorter` so that all `@AutoConfigureBefore` and
`@AutoConfigureAfter` classes are considered even if they are ultimately
not part of the requested set.
Prior to this commit, given classes ordered with annotations such that
A -> B -> C a call to sort only [A, B] could return the incorrect order.
Fixes gh-12660
This commit updates Spring Boot's DeferredImportSelector implementations
to group imports in a consistent set. This makes sure ordering is
applied consistently.
Closes gh-12366
This commit disables the default HTML view in the WebFlux error handling
support when `server.error.whitelabel.enabled=false`.
In this case, the original exception will be forwarded down the stream
and handled by the default `WebExceptionHandler` provided by Spring
WebFlux (likely to respond a blank page and an error HTTP response
status).
Closes gh-12520
This commit fixes 220f8cd and moves the order for
`WelcomePageHandlerMapping` to `2` since the previous order was
conflicting with the resource mapping.
Closes gh-12335
This commit orders the `WelcomePageHandlerMapping` at
`Ordered.LOWEST_PRECEDENCE -1` in order to give a chance to other
mappings to handle the incoming requests.
In this case, developers might provide a custom `ViewController` or
custom `HandlerMapping` for the `"/"` path and we should not override
that opinion.
Closes gh-12335
This commit updates Spring Boot's DeferredImportSelector implementations
to group imports in a consistent set. This makes sure ordering is
applied consistently.
Closes gh-12366
Prior to this commit, all `WebMvcConfigurer` instances provided by user
configuration were processed *before* the one provided by the
`WebMvcAutoConfiguration`.
For many options this has no consequence, but for some, like the
`ContentNegotiationConfigurer`, settings were overriden by the
auto-configuration even if developers provided an opinion.
This commit orders the `WebMvcConfigurer` provided by the
auto-configuration at `0`, so that custom configurers (unordered, at
`Ordered.LOWEST_PRECEDENCE`) are processed *after*.
This still gives room to developers for configuring things *before* the
auto-configuration - they can still order their own configuration
accordingly.
Fixes gh-12389
This commit defers the resolution of the default ddl auto mode only when
it is absolutely necessary. This prevents Spring Boot to attempt to get
a connection when it isn't necessary
Closes gh-12374
Previously, when performing lazy initialisation of the context,
ApplicationContextRequestMatcher assigned the context field before it
called initialized. The context being non-null is used as the signal
that it’s ok to call a subclass’s matches method. If one thread checks
for a non-null context in between the field being assigned and
initialized being called on another thread, matches will be called
before the subclass is ready.
This commit closes the window for the race condition by only assigning
the context field once the subclass’s initialized method has been
called.
There is a secondary problem in each of the subclasses. Due to the use
of double-checked locking in ApplicationContextRequestMatcher, it’s
possible for a subclass’s matches method to be called by a thread that
has not synchronised on the context lock that’s held when initialized
is called and the delegate field is assigned. This means that the
value assigned to the field may not be visible to that thread.
This commit declares the delegate field of each
ApplicationContextRequestMatcher subclass as volatile to ensure that,
following initialisation, its value is guaranteed to be visible to
all threads.
Closes gh-12380
This commit detects if a `ConnectionNameStrategy` bean exists in the
context and associates it with the auto-configured RabbitMQ's
`ConnectionFactory` when that is the case.
Closes gh-12367
Prior to this commit, the `ApplicationContext` couldn't start with a
JDK-proxied `HikariDataSource` as the JMX auto-configuration was
attempting to inject a (too narrowed) `HikariDataSource`.
This commit rather injects a regular `DataSource` and attempt to unwrap
it as a `HikariDataSource`.
Closes gh-12271
Update `ApplicationContextRequestMatcher` and
`ApplicationContextServerWebExchangeMatcher` to use a supplier for
the context, rather than the context itself.
This allow exceptions to be propagated to subclasses which may choose
to deal with them.
See gh-12238
This commit changes invocations to immediately return the expression
instead of assigning it to a temporary variable. The method name should
be sufficient for callers to know exactly what will be returned.
Closes gh-12211
This commit ensures that Tomcat is the first reactive server configured
if the Tomcat dependency is on classpath.
Spring Boot chose Reactor Netty as the default for the reactive web
starter, but the Reactor Netty dependency can be used also for its HTTP
client. In case developers are adding Tomcat, Undertow or Jetty on their
classpath, we must configure those and consider Reactor Netty for the
client only.
Fixes gh-12176