This commit brings MongoClientFactory and ReactiveMongoClientFactory
into functional alignment and reduces duplication in the classes
and their tests.
There are no behavior changes to ReactiveMongoClientFactory.
MongoClientFactory now throws an exception when a URI is configured
along with a host, port, or credentials, where it previousy ignored
host, port, and credentials silently. MongClientFactory now also
supports MongoClientSettingsBuilderCustomizers.
Fixes gh-20019
This commit makes sure that a fallback embedded datasource is not
created if no suitable connection pool is found and an url has been
explicitly registered.
This is consistent with EmbeddedDataSourceConfiguration as it is using
EmbeddedDatabaseBuilder behind the scenes and the latter does not
honour the configured URL anyway.
Closes gh-19192
This commit makes sure to create a HazelcastClient if an instance name
is provided in configuration and if no such client already exists. This
harmonizes the behaviour with of the server counter-part.
See gh-20109
This commit changes the classpath check condition to verify that the
core module of the MongoDB driver is present. Previously, we were only
checking for the presence of the sync driver, making embedded support
unavailable with the reactive variant.
Closes gh-19960
For consistency with SpringApplication, this commit disables bean
overriding by default in ApplicationContextRunner. Bean overriding can
be enabled again using withAllowBeanDefinitionOverriding.
Closes gh-18019
This commit hard codes the default value so that the annotation
processor picks it up. The default value is tested for consistency so
this is acceptable as providing the default value in the metadata
requires to hard code it anyway.
The Cassandra v4 driver does not longer have automatic local DC inference
from contact points. As a result, the "local-datacenter" property must be
set with the default load balancing policy and the contact points must
be of that data center.
This commit adds a new property for the local datacenter so that it can
be specified without the use of a customizer.
Closes gh-19779
This commit changes uses of ClassLoader.loadClass to Class.forName for
consistency with what was initiated in #19342 and better compatibility
with GraalVM.
Closes gh-19824
This class was mistakenly marked as deprecated in 2.2.0 instead of deprecated
in 2.3.0. This resulted in the class being deleted as part of the 2.3.0
cleanup.
Putting it back in place now with the correct deprecation noted.
Closes gh-19861
Update all dependencies declarations to use the form `scope(reference)`
rather than `scope reference`.
Prior to this commit we declared dependencies without parentheses unless
we were forced to add them due to an `exclude`.
Replace Gradle single quote strings with the double quote form
whenever possible. The change helps to being consistency to the
dependencies section where mostly single quotes were used, but
occasionally double quotes were required due to `${}` references.
The Spring Cloud Connectors project has been deprecated in favor of the
Java CFEnv project. The Boot auto-configuration and starter that support
Connectors were deprecated in Boot 2.2.
This commit removes the Connectors auto-configuration, starter,
and dependency management.
Closes gh-19798
This change ensures that each test in a test suite that shares an
application context gets a unique embedded database, to prevent
inconsistent embedded database state between tests.
Closes gh-16747
Change the default `BootstrapMode` for auto-configured `JpaRepositories`
to `BootstrapMode.DEFERRED` to allow the initialization of
`EntityManagerFactory` to be parallelized for increased startup efficiency.
Prior to this change, the default BootstrapMode for all auto-configured
Spring Data repositories was `BootstrapMode.DEFAULT`.
Closes gh-16230
This paves the way for publishing Gradle module metadata once the
problem caused by snapshot versions and our two-step publication
process has been addressed.
See gh-19609
This reverts commit b34a311d02 as,
having disabled the publishing of Gradle's module metadata (4f75ab5),
the changes are no longer needed.
See gh-19609
This commit maps 'spring.cache.redis.key-prefix' to the new
'prefixCacheNameWith' method introduced in Spring Data Neumann. This
makes sure that the configured prefix includes the cache name.
Closes gh-16676
Previously, enforcedPlatform dependencies were using to pull in the
constraints defined in spring-boot-dependencies and
spring-boot-parent and applied them strictly so that the constrained
version had to be used. This worked as intended in Spring Boot's own
build but incorrectly enforced those same strict version requirements
on external consumers of Spring Boot's modules.
This commit reworks how Spring Boot defines its internal dependency
management so that platform dependencies are exposed to external
consumers while enforced platform dependencies are using internally.
See gh-19609
The Elasticsearch transport client has been deprecated since Spring Boot
2.2.0 and is about to be removed from Spring Data Elasticsearch and
Elasticsearch itself in their next major releases.
The available REST client support variants are now the preferred way of
using Elasticsearch features.
Closes gh-19668
Prior to this commit, HTTP client builders auto-configured by Spring
Boot would be eagerly instantiating resources, even if those were not
used by the application.
This commit makes the `RestTemplateBuilder` bean as Lazy.
`WebClient.Builder` was already a prototype bean, but some of its
dependencies could consume resources, like the `HttpClientConnector` and
the related infrastructure. This commit makes those pieces lazy.
Note that since those components are meant to help instantiate actual
HTTP clients for application components, making them lazy won't make any
difference at runtime since they'll be used during context refresh, or
they won't be used at all.
Closes gh-19549
Prior to this commit, the `ErrorController` would override the original
error response status if the error map cannot be written due to content
negotiation with the HTTP client. In that case, the error handling
infrastructure returns a `406 Not Acceptable` response.
This commit improves the `ErrorController` so that
`HttpMediaTypeNotAcceptableException` instances thrown by that
controller are not returned as is but instead we write the error
response with an empty body and the original HTTP error status.
Fixes gh-19545
See gh-19522
Prior to this commit, there was no distinction between explicitly setting
forward headers strategy to a value of NONE and not setting it at all.
This meant that in a cloud environment, a cloud provider was always checked
to see if it was active and using forward headers and there was no way to
prevent that.
This commit changes the default value of the property to null so that there
is a way to determine if the property was explicitly set to NONE.
Fixes gh-19333
Prior to this commit, the `ErrorController` would override the original
error response status if the error map cannot be written due to content
negotiation with the HTTP client. In that case, the error handling
infrastructure returns a `406 Not Acceptable` response.
This commit improves the `ErrorController` so that
`HttpMediaTypeNotAcceptableException` instances thrown by that
controller are not returned as is but instead we write the error
response with an empty body and the original HTTP error status.
Fixes gh-19522
Prior to this commit, the Couchbase auto-configuration would use the
bucket credentials when RBAC is configured. This commit ensures that
RBAC is used in that case.
This commit also adds new configuration properties to customize the
bootstrap ports for Couchbase:
* `spring.couchbase.env.bootstrap.http-direct-port`
* `spring.couchbase.env.bootstrap.http-ssl-port`
Fixes gh-19393
This commit fixes the setup of tests using component scan. Previously,
a configuration used an include filter to only include a particular
configuration class in a given package. Unfortunately, include filters
do not prevent regular filters by default and the definition did not
have the intended behaviour.
This commit disables default filters so that only the specified include
filter is applied.
This commit movers the auto-configuration of RabbitTemplate to a
dedicated class that can be reused to create additional template with
similar settings.
CLoses gh-19440
This commit migrates JobLauncherCommandLineRunner to an
ApplicationRunner implementation. The latter allows to parse option
arguments (i.e. `--spring.something=value`) and makes it easy to ignore
arguments that are not meant to be passed to batch jobs.
Closes gh-19442
This commit improves the LDAP auto-configuration to detect if a
DirContextAuthenticationStrategy bean is defined and, if so, associates
it with the auto-configured `LdapContextSource`.
See gh-19328
There is a direct link between the sslEnabled flag and the default port
that should be used by an address. The checks are currently set in two
places:
* Determine which port should be used
* Determine if SSL should be enabled
This commit polishes the initial proposal so that secureConnection is
only set if a protocol is available.
See gh-19109