Skip to content

Commit e332ce9

Browse files
committed
Fix ControlBusControllerConfiguration for FormattingConversionService
* Use `ObjectProvider<FormattingConversionService>` instead for injection to resolve the target bean later when we check that `spring-mvc` or `spring-webflux` is present in classpath * Fix `control-bus-controller.adoc` for `{beanName}` attribute resolution attempt
1 parent fc9b96a commit e332ce9

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

spring-integration-http/src/main/java/org/springframework/integration/http/config/ControlBusControllerConfiguration.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import org.apache.commons.logging.Log;
2020
import org.apache.commons.logging.LogFactory;
2121

22-
import org.springframework.beans.factory.annotation.Qualifier;
22+
import org.springframework.beans.factory.ObjectProvider;
2323
import org.springframework.beans.factory.config.BeanDefinition;
2424
import org.springframework.context.annotation.Bean;
2525
import org.springframework.context.annotation.Configuration;
@@ -46,18 +46,17 @@ public class ControlBusControllerConfiguration {
4646

4747
@Bean
4848
ControlBusController controlBusController(ControlBusCommandRegistry controlBusCommandRegistry,
49-
@Qualifier("mvcConversionService") FormattingConversionService conversionService) {
49+
ObjectProvider<FormattingConversionService> conversionService) {
5050

5151
if (!HttpContextUtils.WEB_MVC_PRESENT && !HttpContextUtils.WEB_FLUX_PRESENT) {
5252
LOGGER.warn("The 'IntegrationGraphController' isn't registered with the application context because" +
53-
" there is no 'org.springframework.web.servlet.DispatcherServlet' or" +
54-
" 'org.springframework.web.reactive.DispatcherHandler' in the classpath.");
53+
" there is no 'spring-mvc' or 'spring-webflux' in the classpath.");
5554
return null;
5655
}
5756

5857
controlBusCommandRegistry.setEagerInitialization(true);
5958

60-
return new ControlBusController(controlBusCommandRegistry, conversionService);
59+
return new ControlBusController(controlBusCommandRegistry, conversionService.getIfUnique());
6160
}
6261

6362
}

src/reference/antora/modules/ROOT/pages/http/control-bus-controller.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ The `/control-bus` GET request returns all the control bus commands for the appl
6969
Essentially, a JSON-serialized list of `ControlBusController.ControlBusBean` instances.
7070
Each entry is a bean with a list of control bus eligible methods (see `ControlBusMethodFilter` for more information) with their parameter types and description from the `@ManagedOperation` or `@ManagedAttribute` (falls back to method name otherwise).
7171

72-
The GET method of this REST controller for `/control-bus/{beanName}` returns commands for specific bean.
72+
The GET method of this REST controller for `/control-bus/\{beanName}` returns commands for specific bean.
7373

7474
The POST method to `/control-bus/{beanName.methodName}` invokes the command.
7575
The body of the request may contain a list of values and their types for command to execute.

0 commit comments

Comments
 (0)