-
Notifications
You must be signed in to change notification settings - Fork 309
Open
Description
Hello,
In the partitioned-batch-job project, the partitioned handler is created as follows:
@Bean
public PartitionHandler partitionHandler(TaskLauncher taskLauncher, JobExplorer jobExplorer, TaskRepository taskRepository) throws Exception {
...
DeployerPartitionHandler partitionHandler = new DeployerPartitionHandler(taskLauncher, jobExplorer, resource, "workerStep");
...
return partitionHandler;
}
How could I pass the step name, here "workerStep", as an input argument. I tried to modify the method like below:
@Bean
public PartitionHandler partitionHandler(TaskLauncher taskLauncher, JobExplorer jobExplorer, TaskRepository taskRepository, String stepName) throws Exception {
...
DeployerPartitionHandler partitionHandler = new DeployerPartitionHandler(taskLauncher, jobExplorer, resource, stepName);
...
return partitionHandler;
}
and I adapted the job/step definition, but it didn't work. I got an exception saying that the method requires a bean of the type String that wasn't found. Then I defined a bean:
@Bean
public String stepName() {
return new String();
}
and the exception is gone. But I don't think that might be a solution.
Could you please advise ?
Many thanks in advance.
Metadata
Metadata
Assignees
Labels
No labels