Skip to content

Broken code samples in reference documentation for Job/Step beans with v5 API #4406

Closed
@andygoossens

Description

@andygoossens

Commit 219fee3 modified some code examples for the API introduced in v5. Some of those examples won't compile now.

See sections:

Example:

@Bean
public Job sampleJob(JobRepository jobRepository) {
    return new JobBuilder("sampleJob", jobRepository)
                     .start(step1())
                     .build();
}

@Bean
public Step step1(JobRepository jobRepository, PlatformTransactionManager transactionManager) {
	return new StepBuilder("step1", jobRepository)
				.<String, String>chunk(10, transactionManager)
				.reader(itemReader())
				.writer(itemWriter())
				.build();
}

In the sampleJob bean, there is a method call to step1(). But as you see, it does not provide JobRepository and PlatformTransactionManager parameters.

To fix it, those parameters should be provided, or perhaps the sampleJob method should autowire the step1 bean instead.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions