This commit removes the creation of DataSourceProperties in
DataSourceTransactionManagerAutoConfiguration as the latter does not
use the former.
See gh-43603
This commit improves the auto-configuration of JdbcTemplate and
HibernateJpaDialect so that an SQLExceptionTranslator bean is used if
it is available.
See gh-43511
Previously, the default Jackson2ObjectMapperBuilderCustomizer
implementation did set the list of modules to use. This had the effect
of removing any modules that were registered programmatically by a
customizer with higher precedence.
This commit uses the variant of modulesToInstall that retain any
existing modules. It also adds a note in the documentation as this
behavior can be easily missed.
See gh-42836
Before this commit, only a single ResourceHandlerRegistrationCustomizer
was invoked. This commit adds functionality to have more
than one ResourceHandlerRegistrationCustomizers
See gh-43494
Restore `buildConsumerProperties()` and `buildProducerProperties()`
methods in `KafkaProperties` to make it more convenient to use them
without an SSL bundle.
Fixes gh-43300
Update `SslAutoConfiguration` so that the used resource loader prefers
file based resolution when paths are specified without a prefix. This
restores the behavior found in Spring Boot 3.3.
The `ApplicationResourceLoader` has been updated with a new `get` method
that accepts a `preferFileResolution` parameter. Unfortunately, we can't
directly influence the resource returned by the delegate
`ResourceLoader` since we can't override `getResourceByPath(...)`.
Instead we check if the returned type was likely to have been created
by a call to that method. If so, we change it to a `FileSystemResource`.
This approach should hopefully work with `DefaultResourceLoader` and
subclasses.
Fixes gh-43274
This commit refines the optimization introduced in gh-39816 to only
unwrap our own caching connection factory. The more advanced unwrap
algorithm is still available, but opt-in only.
Unwrapping more aggressively may break use cases where the wrapped
ConnectionFactory is required, i.e. for transactional purposes.
Closes gh-43277
Update `AbstractApplicationContextRunner` and `Configurations` to
allow registration of beans with a specific generated bean name. By
default, no name is generated, however, `AutoConfigurations` has been
updated to use bean names using the fully qualified class name.
The update brings `ApplicationContextRunners` closer the behavior of
a standard Spring Boot application where user `@Configuration` classes
are usually registered with a simple name and auto-configurations are
imported (via an `ImportSelector`) using a fully qualified name.
Fixes gh-17963
Co-authored-by: Stéphane Nicoll <stephane.nicoll@broadcom.com>
Co-authored-by: Andy Wilkinson <andy.wilkinson@broadcom.com>
Co-authored-by: Dmytro Nosan <dimanosan@gmail.com>
Add `@Order` to `WebSocketMessageConverterConfiguration` so that custom
`WebSocketMessageBrokerConfigurer` implementations can be added before
or after ours.
Fixes gh-42924
Previously, if a bean name was a factory dereference its definition
would not be found. When the definition wasn't found it was assumed
that the bean was an autowire candidate and a default candidate.
If this, in fact, was not the case, @ConditionalOnMissingBean would
not match when it should have done and @ConditionalOnBean would
match when it should not had done.
This commit updates the bean-based conditions to correctly consider
factory beans so that whether or not they are a candidate can be
evaluated correctly.
Fixes gh-42970
Update `ClientHttpRequestFactoryBuilder` implementations to ensure
that all libraries have consistent redirect follow behavior. Following
of redirects is enabled by default.
The `ClientHttpRequestFactorySettings` may be used to change if
redirects should be followed. The `spring.http.client.redirects`
property may also be used to update the default behavior.
Closes gh-42879
Add a new `HttpClientAutoConfiguration` class that provides
`ClientHttpRequestFactoryBuilder` and `ClientHttpRequestFactorySettings`
beans and new configuration properties.
The existing `RestTemplate`, `RestClient` and `WebServiceTemplate`
auto-configurations have been updated to make use of the new
HTTP client support.
Users may now set `spring.http.client` property to globally change
the `ClientHttpRequestFactory` used in their application.
Closes gh-36266
Update `ApplicationResourceLoader` to support delegation to another
`ResourceLoader`. The update allows customer resource loaders to be
used when loading SSL resources.
Closes gh-42835
Update `SslAutoConfiguration` to the `ApplicationContext` class loader
when loading SSL resources. Prior to this commit, the thread context
class loader was used to load resources which could be incorrect.
Specifically, when using a `ForkJoinPool` the thread context classloader
defaults to the JRE `AppClassLoader` which does not include uber jar
content.
The underlying `JksSslStoreBundle` class and `PemSslStore.load(...)`
method have been updated so support using a provided `ResourceLoader`.
Fixes gh-42468
This commit adapts code that was using GenericBeanDefinition to use
RootBeanDefinition instead. Spring Framework recommend to use
RootBeanDefinition if it's pre-determined as root bean.
See gh-42611
This commit adapts code that was using GenericBeanDefinition to use
RootBeanDefinition instead. Spring Framework recommend to use
RootBeanDefinition if it's pre-determined as root bean.
See gh-42611
Update `OnBeanCondition` to consider the annotations attribute as well
as the types and names when determining if the bean type can be deduced.
Fixes gh-42484
This commit adds the ability for users to customize the auto-configured
Spring for Apache Pulsar message container factories. Each container
factory holds a set of container properties that is a common target for
users to configure. Allowing the customization of these properties
prevents a rapid increase of configuration properties.
See gh-42182
Support `AutoConfiguration.replacements` file that can be placed
alongside an `AutoConfiguration.imports` to replace deprecated
auto-configurations.
Closes gh-14860
This commit restores auto-configuration for using an Embedded broker
with ActiveMQ classic.
Contrary to its 2.7.x version, "spring-boot-starter-activemq" no longer
adds the broker for consistency with Artemis, and to keep the existing
3.x behavior. Rather than "inMemory", a "s.a.embedded.enabled"
property has been reintroduced that matches the name used by Artemis.
The documentation has been updated to mention that the broker
dependency must be added to use it.
Closes gh-38404
This is a follow-up to gh-42062 that utilizes newly introduced
`concurrency` property in `PulsarContainerProperties` to simplify
auto-configuration support for Pulsar listener container concurrency.
See: https://github.com/spring-projects/spring-pulsar/issues/820
See gh-42120
The subscription name config prop was not being set on the Pulsar
listener container properties. This commit adds the subscription
name to the Pulsar property mappers.
See gh-42067
Refine the fix introduced in commit 60b7e6cf23 so that the
`getErrorAttributes()` method is not called multiple times. If the
status is missing, the `DefaultErrorWebExceptionHandler` will now
call an internal `DefaultErrorAttributes` instance in order to obtain
the actual status result.
Fixes gh-41732
This commit allows Pulsar users to configure a default tenant
and/or namespace to be used when producing or consuming messages
to topic URLs that are not fully-qualified.
See gh-41851
Artemis does not work on Java 23, this commit therefore disables those
tests when running against a Java version higher than 22.
See https://issues.apache.org/jira/browse/ARTEMIS-4975
Unfortunately, the version of JUnit that we use has no value for Java
23, so we have to use OTHER for that purpose.
Infinispan 14 does not work on Java 23, an upgrade to 15 is required.
This commit therefore disables those tests when running against a Java
version higher than 22.
Unfortunately, the version of JUnit that we use has no value for Java
23, so we have to use OTHER for that purpose.
This commit moves the setup of vendor properties (e.g. Hibernate) from
the auto-configured LocalContainerEntityManagerFactoryBean to the
auto-configured EntityManagerFactoryBuilder. This way, custom use of
the latter retains additional auto-configuration logic such as the
naming strategy and DDL mode to use.
Closes gh-15318
This commit updates the configuration metadata and the reference guide
to mention that certain FreeMarker features are not available with
WebFlux.
This stems mostly from the fact that the WebFlux integration is not
based on a AbstractTemplateView.
Closes gh-11199
This commit updates the auto-configuration to allow custom FreeMarker
variables to be provided programmatically. As these variables are
usually objects, they cannot be specified via properties.
Closes gh-8965
Prior to this commit, the configured GraphQL routes would reply with an
HTTP 404 status when a POST request is sent with an unsupported content
type, such as "text/plain". While such requests are not supported in the
first place, we should help developers and let them know that the
content type sent is the problem.
This commit configures new routes that reply with HTTP 415 "Unsupported
Media Type" for these cases.
Closes gh-41675
This commit gathers `HandlerMethodArgumentResolver` beans contributed by
the application and sets them up on the auto-configured
`AnnotatedControllerConfigurer` bean.
This allows easier registrationsfor custom argument resolvers in Spring
for GraphQL applications.
Closes gh-40393
This commit updates the auto-configuration to use the native connection
factory for configuring message listener containers. Previously, the
connection factory that could have been wrapped in a caching connection
factory was used.
While using a caching connection factory is suitable for sending
messages (i.e. JmsTemplate usage), it isn't for message listeners as
they need to own the connection for local recovery purposes.
Closes gh-39816
Previously, if a failure occurred when evaluating conditions on a
separate thread, an NPE would occur on the main thread as the
expected array of outcomes was null.
This commit avoids the NPE and the lack of error reporting by
rethrowing on the main thread any failure that occurs on the
separate thread that's spawned to parallelize the evaluation.
Closes gh-41492