Skip to content

Add ability to use bean names for jobs and steps #4858

Closed
@fmbenhassine

Description

@fmbenhassine

As of v5.2, both AbstractJob and AbstractStep implement BeanNameAware. So it could be possible to use the bean name as a default job/step name in order to avoid duplication:

@Bean
public Job job(JobRepository jobRepository, Step step) {
--	return new JobBuilder("job", jobRepository)
++	return new JobBuilder(jobRepository)
                           .start(step)
                           .build();
}

Obviously, the current constructor that takes the job/step name should remain to be able to specify a different name if needed.

cc @joshlong

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions