This commit changes the requested endpoint for the Jest
HealthIndicator. The `"/_all/_stats"` was previously used, but
the response size can be quite large and costly.
This is now using the `"/_cluster/health"` endpoint.
This covers the cases when:
* An Java agent based reloader (e.g. JRebel) is being used
* The reloader was disabled by using a system property
See gh-14807
An initializer that adds a BeanDefinitionRegistryPostProcessor which
in turn adds bean definitions has to be very careful to run early.
Otherwise, other initializers that want to influence the bean
definitions added never get a chance.
Closes gh-14907
Fix Jetty and Undertow customizers to restore Spring Boot 2.0
behavior where a negative or zero `max-http-header-size` indicates
that the server default should be used.
Closes gh-14986
Fix `TomcatWebServerFactoryCustomizer` to restore Spring Boot 2.0
behavior where a negative or zero `max-http-header-size` indicates
that the server default should be used.
See gh-14986
Add a managed dependency for `org.jvnet.mimepull:mimepull` so that
`spring-boot-starter-web-services` works with Java 11.
Although we don't directly depend on mimepull ourselves, there is an
transitive dependency from `com.sun.xml.messaging.saaj:saaj-impl:1.5.0`
which unfortunately references a version that was never published to
Maven Central.
Closes gh-14924
Update `AliasedConfigurationPropertySource` to consider aliases in
`containsDescendantOf`.
Prior to this commit, given a source containing `example.name` with
a defined alias of `other.name -> example.name` calling
`containsDescendantOf("other")` would incorrectly return
`ConfigurationPropertyState.ABSENT`.
Closes gh-14967
Fix the `JobLauncherCommandLineRunner` to correctly deal with job
parameters when restarting a job.
Prior to this commit, we were was calling the `getNextJobParameters`
method of the `JobParametersBuilder` from batch. This method was getting
the previous parameters of the wrong job instance in a restart scenario.
This commit fixes the issue by first getting the right job instance with
the provided parameters, then restarting it.
Closes gh-14933
Update `ApplicationContextAssert.getBean` so that multiple beans are
supported as long as one of them is primary. This aligns better with
the way that the standard `ApplicationContext.getBean` method works.
Closes gh-14874
Change `ApplicationConversionService.getSharedInstance()` to again
return a `ConversionService` rather than `ApplicationConversionService`.
This restore binary compatibly with Spring Boot 2.0
Closes gh-14938
Add a new condition that can be used to check for servlet `Filter`
beans that are either registered directly, or via a
`FilterRegistrationBean`.
Closes gh-14940
Add a `parameterizedContainer` attribute to `ConditionalOnBean` and
`ConditionalOnMissingBean` which can be used to support generic types
when checking for the presence of beans.
Closes gh-14940
Fix `ResourceUrlEncodingFilter` conditions which were inadvertently
changed in commits 64f04fce and 6cc272ec and would back off if any
`FilterRegistrationBean` was found.
The updated conditions restores the behavior of Spring Boot 2.0.5 and
allows users to directly register their own `ResourceUrlEncodingFilter`
beans (as long as they don't use a `FilterRegistrationBean`).
Fixes gh-14897
Previously, when using Tomcat, a call to mappings endpoint would force
the initialization of any DispatcherServlets in the context. This was
done by calling allocate on Tomcat's StandardWrapper. This left the
wrapper in a state that would cause it to block for two seconds during
shutdown as the wrapper has an outstanding allocation.
This commit immediately deallocates the servlet after it has been
allocated. This ensures that the DispatcherServlet has been initialized
while also leaving the wrapper in a state that it can shut down
immediately when asked to do so.
Closes gh-14898
SPR-17395 ensures that WebFlux.fn is adding a request attribute of type
`PathPattern` on the `HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE`.
A specific tag provider for WebFlux.fn is no longer necessary.
See gh-14876
This commit adds the following configuration properties:
* `spring.thymeleaf.render-hidden-markers-before-checkboxes`
* `spring.thymeleaf.servlet.produce-partial-output-while-processing`
Complete the restructuring of the security auto-configuration
packages by removing the direct import of web configuration from
the main security auto-configuration.
Closes gh-14412
Update `WebEndpointDiscoverer` and related classes to that multiple
`PathMapper` beans can be registered. Mappers are now tried in order
until one returns a non-null value.
Closes gh-14841
This commit updates the documentation to reference the default execution
id of the `repackage` goal when a project uses
`spring-boot-starter-parent`.
Closes gh-14835
This commit shows the stacktrace information in default WhiteLabel error
views for Spring MVC and Spring WebFlux.
This information is only shown if it is present in the model map, which
depends on the `server.error.include-stacktrace` configuration property.
Closes gh-12838
Previously, Couchbase's health was determined by retrieving the bucket info
from the cluster info. This retrieval could take over one minute in some
cases even when Couchbase is health. This latency is too large for a health
check.
The Couchbase team have recommended the of a Cluster#diagnostics instead.
This provides a much lower latency view of the cluster's health. This
commit updates CouchbaseHealthIndicator to use Cluster#diagnostics while
retaining support, in a deprecated form, for the old info-based mechanism
should anyone want to opt back into that in 2.0.x.
Closes gh-14685
Update `MappingWebEndpointPathMapper` to use the lowercase version of
the endpoint ID when no explicit path mapping has been set. An endpoint
with the ID 'myEndpoint' will now be mapped to the path 'myendpoint'.
See gh-14773
Update `ExposeExcludePropertyEndpointFilter` so that mixed case
endpoint IDs are supported. Prior to this commit it was not easy for
an endpoint to be missed by the filter due to the formatting of the
property value.
See gh-14773
Update `OnEnabledEndpointCondition` so that mixed case endpoint IDs
are supported. Prior to this commit an
`InvalidConfigurationPropertyNameException` would be thrown when trying
to enabled or disable an endpoint with a camel case ID.
See gh-14773
Update the endpoint time-to-live binding logic so that mixed case
endpoint IDs are supported. Prior to this commit an
`InvalidConfigurationPropertyNameException` would be thrown when using
a camel case endpoint ID.
See gh-14773
Add an `EndpointID` class to enforce the naming rules that we support
for actuator endpoints. We now ensure that all endpoint names contain
only letters and numbers and must begin with a lower-case letter.
Existing public classes and interfaces have been changes so that String
based `endpointId` methods are deprecated and strongly typed versions
are preferred instead. A few public classes that we're not expecting
to be used directly have been changed without deprecated methods being
introduced.
See gh-14773
This commit adds support for @ResponseStatus in DefaultErrorAttributes
mimicking the semantics of @ResponseStatus in SpringMVC.
Throwables annotated with @ResponseStatus handled by
DefaultErrorAttributes will result in the following error attributes:
* 'status' set as the return value of the HttpStatus#value()
defined as @ResponseStatus#value()
* 'error' set to the default reason phrase of the HttpStatus
defined as @ResponseStatus#value()
* 'message' defined as the value of @ResponseStatus#reason(),
or the default HttpStatus's reason phrase if left unspecified
See gh-14744
This commit auto-configures HTTP resource factories on both Reactor
Netty and Jetty server instances. This creates `ReactorResourceFactory`
and `JettyResourceFactory` beans when necessary - those beans can be
reused and applied by the client auto-configuration in order to share
resources between client and server for optimal performance.
The server auto-configuration has the highest precedence, so from now
on, the auto-configured ResourceFactory bean on the client side will be
skipped if a reactive server is configured.
Closes gh-14495
Add `Ordered` variants of `javax.servlet.Filter` and
`org.springframework.web.server.WebFilter` mainly so that we can
deprecate `FilterRegistrationBean.REQUEST_WRAPPER_FILTER_MAX_ORDER`.
Closes gh-14793
Ensure that all servlet containers handle servlet startup failures
consistently and throw a `WebServerException` that wraps the original
cause.
Both Undertow and Jetty already dealt with startup failures in this
way, but Tomcat did not. The `TomcatEmbeddedContext` has now been
changed to no longer call `super.loadOnStartup` but instead re-implement
a version of that method that wraps and rethrows the original exception
(as long as `failCtxIfServletStartFails` is `true`, which it now is by
default).
Closes gh-14790
Remove the reflection tests used to support the older variant of
`overrideLoadOnStart` that returned a void. Since we no longer support
that older version we can simply the code.
Closes gh-14789
Ensure that if the user has set `failCtxIfServletStartFails` to `true`
using a `ContextCustomizers` any Servlet init exceptions stop the
application from running.
Closes gh-14448
Update `MetricsEndpoint` so that only the first matching meter is used
when calculating the sum of of statistics.
Prior this this commit the endpoint would consider all Meters. This
caused incorrect statistics when multiple back-end systems were being
used since the registries contained in the `CompositeMeterRegistry`
would be iterated, and the same effective metric would be counted more
than once.
Closes gh-14497
This commit adds a new configuration property
`"spring.webflux.hiddenmethod.filter.enable"` that enables/disables the
`HttpHiddenMethodFilter` in Spring WebFlux.
Closes gh-14520
This commit stops binding the Flyway object directly to the environment
as mutating it will no longer be supported in Flyway 6.
This commit mirrors Flyway's configuration in FlywayProperties for the
most part.
Closes gh-14776
Previously, the API required to create HttpTrace instances was
package-private. This made it difficult to implement an
HttpTraceRepository that persists the HttpTrace instances
rather than holding them in memory as it inhibited recreation of the
instances when they read from the persistent store.
This commit adds public constructors to HttpTrace and related classes
to enable recreation of an HttpTrace. The package-private methods for
mutating properties have not been made public to ensure that the
public API remains immutable.
Closes gh-14726
Update the logic in `OnClassCondition` so that filtering exits on the
first missing class. Also refactor the implementation to save
unnecessary `Set` creation when there is just a single class to check.
The `AutoConfigureAnnotationProcessor` has also been updated to order
classes so that any starting `org.springframework` are considered last.
The assumption being that other classes are more likely to be missing.
Closes gh-12131
Allow custom `BinderHandler` advise to be applied to the `Binder` used
for `@ConfigurationProperties`. This mechanism has been added to allow
Spring Cloud Stream to manipulate `Bindable` instances before binding
occurs.
NOTE: This commit introduces a breaking change to the `BindHandler`
interface since the `onStart` method now returns a `Bindable` rather
than a `boolean`.
Closes gh-14745
Allow Cassandra JMX reporting to be configured via a property, and
disable it by default since it won't work with Dropwizard metrics 4.
Also update some of our own tests to explicitly disable it.
Closes gh-14778
This commit improve the logger-name value hint by adding a group
attribute that can be defined to specify whether logging groups should
be considered.
Closes gh-14748
In 2.3.1, the JAX-B API now depends on javax.activation-api. This has
caused duplicate Activation classes to appear in the starter due to
dependencies on both javax.activation:activation:1.1 and on
javax.activation:javax.activation-api:1.2. This commit removes the
duplicate classes by excluding the former in favour of the latter.
See gh-14754
A recent update to SpringBeanJobFactory provides the same features as
our AutowireCapableBeanJobFactory override so this commit removes it in
favour of the standard factory.
Closes gh-14772
Previously, if the call to connection.start() hung, JmsHealthIndicator
would also hang and then never respond.
This commit introduces the use of an additional thread that waits for
up to 5 seconds for the connection to start. If the call to start
does not complete within that time, the connection is closed. The
call to close causes the call to start to throw an exception, thereby
stopping the hang and allowing the indicator to report that the
broker is down.
Closes gh-10809
This commit introduces a dedicated hook point for InfluxDB's http client
builder and retains backward compatibility, in a deprecated fashion, for
looking up a OkHttpClient.Builder bean.
Closes gh-14709
Previously, if WebFlux and Jersey were on the classpath, but there was
no Servlet API (and no embedded container) on the classpath, the web
application type would be prevented from being reactive. The absence
of the Servlet API would then prevent the web application type from
being servlet so it would be none.
By contrast, if Spring MVC was on the classpath in place of Jersey
the absence of the Servlet API would allow the web application type to
be reactive. This happened because the Spring MVC indicator class is
DispatcherServlet which requires the Servlet API.
This commit updates the Jersey indicator class to be ServletContainer.
This class is both an HttpServlet and a Filter so it too requires the
Servlet API and, therefore, further aligns the deduction behaviour for
Jersey and Spring MVC.
Closes gh-14701
Rework Prometheus push gateway support so that the central class can
be used outside of auto-configuration. The shutdown flags have also
been replaced with a single "shutdown-operation" property since it's
unlikely that both "push" and "delete" will be required.
It's also possible now to supply a `TaskScheduler` to the manager.
See gh-14353
Update `DevToolsPropertyDefaultsPostProcessor` to automatically set
the recently introduced `spring.messages.reloadable` property to
`true`.
Closes gh-14699