Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

PartitionedHandler: How to pass the step name as an input argument ?

Open
#791 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
java, spring
Domain
backend

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from spring-cloud/spring-cloud-task

All issues in spring-cloud/spring-cloud-task

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.