Spring Integration: RemoteChunkingManagerStepBuilderFactory не вызывает мой метод «чтения» - PullRequest
0 голосов
/ 27 января 2020

Я пытаюсь внедрить Spring Integrations в мой проект, но мой "managerBuilderFactory" не вызывает метод внутри "reader()". Если я попытаюсь отладить код, я могу убедиться, что после чтения я не получаю доступ к методу "itemReader()".

Это мой файл конфигурации. Любая помощь будет по-настоящему оценена

@Configuration
@EnableBatchProcessing
@EnableBatchIntegration
@EnableIntegration
@PropertySource("classpath:application.properties")
public class ConfigData extends ConfigData {

    @Autowired
    private JobBuilderFactory jobBuilderFactory;

    @Autowired
    private RemoteChunkingManagerStepBuilderFactory managerBuilderFactory;


    @Bean
    public DirectChannel channel1() {
        return new DirectChannel();
    }


    @Bean
    public QueueChannel replies2() {
        return new QueueChannel();
    }


    @Bean
    public Job remoteJob() throws Exception {
        return this.jobBuilderFactory.get("Job5")
                .start(manager())
                .build();
    }

    @Bean
    public TaskletStep manager() throws Exception {

        return this.managerBuilderFactory.get("manager")
                .<String, String>chunk(5)
                .reader(ItemReader()) //this method is not beeing called
                .outputChannel(channel1())
                .inputChannel(replies2())
                .build();
    }

    @Bean
    @StepScope
    public ItemReader<String> itemReader() {

        String folderPath = "/folder";
        //doing something with this
        SomeClass<String> result = new SomeClass<>(); 

        return result;
    }
}
...