Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

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

Ouverte
#791 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
30/100
Type d'issue
Fonctionnalité
Clarté
À clarifier
Activité
À l'abandon
Stack technique
java, spring
Domaine
backend

Piste de recherche

Commencez par l’exemple de partitioned-batch-job et le bean partitionHandler présentés dans l’issue ; suivez la manière dont DeployerPartitionHandler reçoit le nom de son step et dont Spring résout les paramètres de méthode. Consultez la configuration ou la documentation de référence pertinente, puis documentez une manière prise en charge de fournir un nom qui ne soit pas codé en dur et vérifiez que l’exemple démarre correctement.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

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.

Langage dominant
Java
Étoiles
445
Forks
310
Merge moyen
11 h 6 min
PR mergées (30 j)
6

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de spring-cloud/spring-cloud-task

Toutes les issues de spring-cloud/spring-cloud-task

Issues similaires

Plus d'issues Java

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.