I am trying to start file inbound channel adapter via control bus, but I am getting exceptions while ExpressionCommandMessageProcessor is trying to parse my command.
Here is my inbound channel adapter configuration:
@Bean(name = "inboundChannelAdapter")
public IntegrationFlow inputFilesReadingFlow()
{
return IntegrationFlows
.from(s -> s.file(new File(inputDirectory))
.filter(new AcceptAllFileListFilter<File>()),
e -> e.poller(Pollers.fixedDelay(FILE_POLLER_RATE))
.autoStartup(false)
)
.handle(messageProcessingService)
.channel(fileOutputChannel)
.get();
}
@Bean
public IntegrationFlow controlBusFlow()
{
return IntegrationFlows.from("controlBusChannel").controlBus().get();
}
In my integration test I have autowired control bus bean:
@Autowired
private MessageChannel controlBusChannel;
@Test
public void testInboundChannelAdapter()
{
controlBusChannel.send(new GenericMessage<String>("@'inboundChannelAdapter.<property_name_placeholder>'.start()")); // ????
// .....
}
So I'd like to ask how I can access 'adapter' bean(or whatever bean is responsible for the start/stop action) to initiate polling process.
Thank you.