GH-9381: Introduce Control Bus commands management
Fixes: #9381 Currently, there is no way to know in one place what Control Bus commands are available and with what arguments * Add `ControlBusCommandRegistry` infrastructure bean to gather control bus commands from beans and expose them for invocation * Add `ControlBusController` to expose a `/control-bus` REST service against the mentioned `ControlBusCommandRegistry` * Add `@EnableIntegrationManagement(loadControlBusCommands)` to be able to load all the Control Bus commands from the application context instead of on demand by default * Deprecated existing SpEL(and Groovy)-based Control Bus functionality in favor of new, more manageable, logic
This commit is contained in:
@@ -167,14 +167,14 @@ public class JmsTests extends ActiveMQMultiContextTests {
|
||||
|
||||
@Test
|
||||
public void testPollingFlow() {
|
||||
this.controlBus.send("@'integerMessageSource.inboundChannelAdapter'.start()");
|
||||
this.controlBus.send("'integerMessageSource.inboundChannelAdapter'.start");
|
||||
assertThat(this.beanFactory.getBean("integerChannel")).isInstanceOf(FixedSubscriberChannel.class);
|
||||
for (int i = 0; i < 5; i++) {
|
||||
Message<?> message = this.outputChannel.receive(20000);
|
||||
assertThat(message).isNotNull();
|
||||
assertThat(message.getPayload()).isEqualTo("" + i);
|
||||
}
|
||||
this.controlBus.send("@'integerMessageSource.inboundChannelAdapter'.stop()");
|
||||
this.controlBus.send("'integerMessageSource.inboundChannelAdapter'.stop");
|
||||
|
||||
assertThat(((InterceptableChannel) this.outputChannel).getInterceptors())
|
||||
.contains(this.testChannelInterceptor);
|
||||
@@ -358,7 +358,7 @@ public class JmsTests extends ActiveMQMultiContextTests {
|
||||
|
||||
@Bean
|
||||
public IntegrationFlow controlBus() {
|
||||
return IntegrationFlowDefinition::controlBus;
|
||||
return IntegrationFlowDefinition::controlBusOnRegistry;
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
Reference in New Issue
Block a user