Update `HttpServiceClientProperties` to use direct binding rather than
using `@ConfigurationProperties`. The prevents metadata and IDE issues
and also allows the class API to be simplified.
Closes gh-48616
This commit fixes a regression where RANDOM_PORT was no longer honored
if a defined management port is set. Due to the modularization efforts,
the code has moved from an EnvironmentPostProcessor to an
ApplicationListener. Unfortunately, the listener is registered too
late to handle the event it is listening to. While the event type could
have been changed, the listener was added on the ApplicationContext
which are not honored before the ApplicationContext is in a state to be
used.
The contract of ContextCustomizerFactory is already giving us everything
we need. While the environment is post-processed later than we would
like, it is still post-processed before the refresh state so that the
additional property is honored.
This commit also adds an integration test to cover this scenario.
Closes gh-48653
Prior to this commit, gh-48310 separated client and server message
converter configurations by switching from message converter instances
as beans in the application context, to server/client customizers that
are applied to the `HttpMessageConverters` instances while being built.
This change did not order the new ClientHttpMessageConvertersCustomizer
or ServerHttpMessageConvertersCustomizer, letting those being at the
"lowest precedence" default. As customizers, this means they are applied
last and custom instances cannot take over.
This commit ensures that such customizers provided by Spring Boot are
now ordered at "0" to let applications ones take over.
Fixes gh-48635
Prior to this commit, gh-48310 separated client and server message
converter configurations by switching from message converter instances
as beans in the application context, to server/client customizers that
are applied to the `HttpMessageConverters` instances while being built.
This change did not order the new ClientHttpMessageConvertersCustomizer
or ServerHttpMessageConvertersCustomizer, letting those being at the
"lowest precedence" default. As customizers, this means they are applied
last and custom instances cannot take over.
This commit ensures that such customizers provided by Spring Boot are
now ordered at "0" to let applications ones take over.
Fixes gh-48609
This commit improves the auto-configuration of the JSonMapper.Builder
to accept a custom JsonFactory if a bean of this type is present.
Closes gh-48594
This commit improves the builder to provide the message factory upfront
rather than setting it after the WebServiceTemplate has been
instantiated.
By providing the factory upfront (if it is set), it prevents the
default strategy to be created first to be then erased by the custom
factory.
Closes gh-48615
The MustacheResourceTemplateLoader previously defined the template
encoding as a String, defaulting to "UTF-8". This change replaces the
field with a Charset and initializes it with StandardCharsets.UTF_8.
Using Charset improves type safety and aligns with modern Spring Boot
standards, while avoiding implicit charset lookup issues.
See gh-48347
Signed-off-by: djlee <ddongjunn@gmail.com>
This commit auto-configures the following beans with their corresponding
conventions, when available:
- ProcessorMetrics with JvmCpuMeterConventions
- JvmMemoryMetrics with JvmMemoryMeterConventions
- JvmThreadMetrics with JvmThreadMeterConventions
- ClassLoaderMetrics with JvmClassLoadingMeterConventions
See gh-47935
Signed-off-by: Dmytro Nosan <dimanosan@gmail.com>
This commit introduces a `SimpleJmsListenerContainerFactoryConfigurer`
that can be used to conveniently apply settings provided
by JMS auto-configuration to `SimpleJmsListenerContainerFactory`
instances.
See gh-47716
Signed-off-by: Vedran Pavic <vedran@vedranpavic.com>
JdbcSessionAutoConfiguration is conditional on the DataSource bean
which won't exist until after DataSourceAutoConfiguration; therefore,
JdbcSessionAutoConfiguration must auto-configure after
DataSourceAutoConfiguration.
Signed-off-by: Craig Andrews <candrews@integralblue.com>
See gh-48552
Previously, the connection details would only back off if another
PropertiesOtlpLoggingConnectionDetails was defined. This commit
corrects this so that they will back of if any
OtlpLoggingConnectionDetails implementation is defined as a bean.
Closes gh-48536
Introduce a strategy to `WebApplicationType` to allow modules to
implement deduction logic.
Prior to this commit, modules played no part in deducing the
`WebApplicationType`. This meant that a user with `spring-webflux`
for client purposes would deduce `REACTIVE` despite no
`spring-boot-webflux` module being present.
The following deduction logic order is now implemented:
1) If the `spring-boot-webmvc` module is being used and Spring MVC
classes are found then `SERVLET` is used.
2) If the `spring-boot-webflux` module is being used and Spring WebFlux
classes are found then `REACTIVE` is used.
3) If `spring-web` is found and servlet classes are available then
`SERVLET` is used.
4) If none of the above are satisfied, `NONE` is used.
This commit also updates `SpringBootTestContextBootstrapper` to use
the same deduction logic.
Fixes gh-48517
This commit moves the `ConditionalOnEnabledLoggingExport` condition from
the "spring-boot-actuator-autoconfigure" to the
"spring-boot-opentelemetry" one, because without that the logging export
feature requires the actuator module to be on the classpath.
Fixes gh-48488
Prior to this commit, the `HttpMessageConverters` auto-configuration
would pick up `HttpMessageConverter<?>` beans from the context and
broadly apply them to both server and client converters setup.
This can cause several types of problems.
First, specific configurations only meant for server setup will also be
applied to the client side. For example, the Actuator JSOn configuration
is only meant to be applied to the server infrastructure.
Also, picking up converters from the context does not convey whether
such converters are meant to override the default ones or should be
configured as custom, in addition to the defaults.
For example, a bean extending `JacksonJsonHttpMessageConverter` can be
both meant to override the default with `builder.withJsonConverter` or
meant as an additional converter with `builder.addCustomConverter`.
This commit ensures that the auto-configurations contribute
`ClientHttpMessageConvertersCustomizer` and
`ServerHttpMessageConvertersCustomizer` beans instead of converter beans
directly. Applications can still contribute such beans and those will be
used.
Fixes gh-48310