Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#791 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
java, spring
領域
backend

調査の方向性

Issue に示されている partitioned-batch-job の例と partitionHandler bean から始め、DeployerPartitionHandler が step 名をどのように受け取り、Spring がメソッドパラメーターをどのように解決するかを追跡します。関連する設定またはリファレンスドキュメントを確認し、ハードコードされていない名前を指定するサポート対象の方法を文書化してから、例が正常に起動することを検証します。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Java
スター
445
フォーク
310
平均マージ
11時間 6分
マージ済み PR(30日)
6

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

spring-cloud/spring-cloud-task のほかの issue

spring-cloud/spring-cloud-task の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。