Я новичок в Spring Integration.Я написал этот код, который загружается весной и вызывает исключение. «Бин с именем« messageSource », как ожидается, будет иметь тип« org.springframework.context.MessageSource », но на самом деле имел тип« org.springframework.integration.file.FileReadingMessageSource ».'"
Код:
@Configuration
/*@EnableIntegration annotation designates this class as a Spring Integration configuration.*/
@EnableIntegration
public class SIConfig {
@Bean
public MessageChannel channel() {
return new DirectChannel();
}
//bydefault name of method
@Bean
public MessageSource messageSource() {
FileReadingMessageSource ms= new FileReadingMessageSource();
ms.setDirectory(new File("C:\\Users\\payal\\Pictures"));
ms.setFilter(new SimplePatternFileListFilter("*.mp4"));
return ms;
}
@Bean
public MessageHandler handler() {
FileWritingMessageHandler handler= new FileWritingMessageHandler(new File("C:\\Users\\payal\\Documents\\batch7"));
handler.setFileExistsMode(FileExistsMode.IGNORE);
handler.setExpectReply(false);
return handler;
}
@Bean
public IntegrationFlow flow() {
return IntegrationFlows.from(messageSource(), configurer -> configurer.poller(Pollers.fixedDelay(10000)))
.channel(channel())
.handle(handler()).get();
}
}
Поскольку с помощью загрузки автоматически управляются версии
Загруженный код и в GitHub:
https://github.com/LearningNewTechnology/SpringIntegrationOne
Любая помощь будет очень признательна.