PartitionedHandler: How to pass the step name as an input argument ?
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
Research direction
Start with the partitioned-batch-job example and the partitionHandler bean shown in the issue; trace how DeployerPartitionHandler receives its step name and how Spring resolves method parameters. Check the relevant configuration or reference documentation, then document a supported way to supply a non-hard-coded name and verify the example starts successfully.
Written by the indexing model from the issue text.
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.
- Dominant language
- Java
- Stars
- 445
- Forks
- 310
- Avg merge
- 11h 6m
- Merged PRs (30d)
- 6
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from spring-cloud/spring-cloud-task
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
spring-cloud/spring-cloud-task#954 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
spring-cloud/spring-cloud-task#953 · 1 comment ·
-
status: waiting-on-feedback
Difficulty 4/5 3-5 days Newbie friendliness 25/100
spring-cloud/spring-cloud-task#952 · 2 comments ·
-
App is failing with 'taskLifecycleListener' bean initialization errors post Spring Boot 3.x upgradeOpenstatus: waiting-on-feedback
Difficulty 5/5 Over a week Newbie friendliness 15/100
spring-cloud/spring-cloud-task#950 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
All issues in spring-cloud/spring-cloud-task
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenAPITools/openapi-generator#25014 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
AloisSeckar/demos-java#380 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openhab/openhab-core#5847 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
appsmithorg/appsmith#42297 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100