Многопоточная пошаговая обработка Spring Batch - PullRequest
0 голосов
/ 14 января 2019

У меня настроены jdbcPagingReader и JpaItemWriter. Я вызываю задание с шагом, в котором есть многопоточный исполнитель задач, как показано ниже.

public Step step() {
        return stepBuilderFactory.get("myJob")
                .chunk(500)
                .reader(jdbcPagingItemReader)
                .writer(jpaItemWriter)
                .taskExecutor(MySimpleAsyncTaskExecutor)
                .throttleLimit(100)
                .build();
    }

Но я вижу, что очень мало записей попадает в базу данных даже после долгого времени. Я установил размер страницы, равный размеру интервала фрагмента / коммита.

Что может быть возможной ошибкой, которую я здесь делаю ..?

Журналы для справки

2019-01-14 19:08:07.257 DEBUG 3100 --- [TaskExecutor 25] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=33
2019-01-14 19:08:07.257 DEBUG 3100 --- [TaskExecutor 79] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=19
2019-01-14 19:08:07.257 DEBUG 3100 --- [TaskExecutor 75] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=36
2019-01-14 19:08:07.257 DEBUG 3100 --- [TaskExecutor 49] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=37
2019-01-14 19:08:07.257 DEBUG 3100 --- [askExecutor 100] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=13
2019-01-14 19:08:07.257 DEBUG 3100 --- [TaskExecutor 69] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=20
2019-01-14 19:08:07.257 DEBUG 3100 --- [TaskExecutor 72] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=19
2019-01-14 19:08:07.257 DEBUG 3100 --- [TaskExecutor 36] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=36
2019-01-14 19:08:07.257 DEBUG 3100 --- [-TaskExecutor 7] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=37
2019-01-14 19:08:07.258 DEBUG 3100 --- [TaskExecutor 18] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=72
2019-01-14 19:08:07.258 DEBUG 3100 --- [TaskExecutor 84] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=22
2019-01-14 19:08:07.258 DEBUG 3100 --- [TaskExecutor 86] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=20
2019-01-14 19:08:07.258 DEBUG 3100 --- [TaskExecutor 74] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=21
2019-01-14 19:08:07.258 DEBUG 3100 --- [TaskExecutor 65] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=39
2019-01-14 19:08:07.258 DEBUG 3100 --- [TaskExecutor 17] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=26
2019-01-14 19:08:07.258 DEBUG 3100 --- [TaskExecutor 20] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=22
2019-01-14 19:08:07.258 DEBUG 3100 --- [TaskExecutor 51] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=16
2019-01-14 19:08:07.258 DEBUG 3100 --- [TaskExecutor 33] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=14
2019-01-14 19:08:07.258 DEBUG 3100 --- [TaskExecutor 28] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=16
2019-01-14 19:08:07.258 DEBUG 3100 --- [TaskExecutor 31] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=26
2019-01-14 19:08:07.258 DEBUG 3100 --- [TaskExecutor 76] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=19
2019-01-14 19:08:07.258 DEBUG 3100 --- [TaskExecutor 95] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=11
2019-01-14 19:08:07.258 DEBUG 3100 --- [TaskExecutor 64] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=9
2019-01-14 19:08:07.258 DEBUG 3100 --- [TaskExecutor 12] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=10
2019-01-14 19:08:07.258 DEBUG 3100 --- [-TaskExecutor 8] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=9
2019-01-14 19:08:07.258 DEBUG 3100 --- [-TaskExecutor 1] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=10
2019-01-14 19:08:07.258 DEBUG 3100 --- [TaskExecutor 39] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=10
2019-01-14 19:08:07.258 DEBUG 3100 --- [TaskExecutor 99] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=14
2019-01-14 19:08:07.258 DEBUG 3100 --- [TaskExecutor 41] o.s.batch.repeat.support.RepeatTemplate  : Repeat operation about to start at count=8
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...