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