Reject setups with multiple observation conventions
Prior to this commit, the `WebHttpHandlerBuilder` would only configure a custom observation convention if there is a single convention in the application context. It would other wise use the default. This commit aligns with the previous Spring Boot behavior where multiple conventions setups are rejected as invalid with `NoUniqueBeanDefinitionException`. Fixes gh-31864
This commit is contained in:
@@ -198,7 +198,7 @@ public final class WebHttpHandlerBuilder {
|
||||
.forEach(builder::httpHandlerDecorator);
|
||||
|
||||
context.getBeanProvider(ObservationRegistry.class).ifUnique(builder::observationRegistry);
|
||||
context.getBeanProvider(ServerRequestObservationConvention.class).ifUnique(builder::observationConvention);
|
||||
context.getBeanProvider(ServerRequestObservationConvention.class).ifAvailable(builder::observationConvention);
|
||||
|
||||
try {
|
||||
builder.sessionManager(
|
||||
|
||||
Reference in New Issue
Block a user