2017-12-06 14 views
0

私はスプリングバッチのパーティションパターンに従っています。現在、私はここで10の固定されたグリッドサイズは、マスタジョブの設定です使用しています:スプリングバッチの環境変数からグリッドサイズ

<batch:step id="master"> 
     <batch:partition step="slave" partitioner="rangePartitioner"> 
     <batch:handler grid-size="10" task-executor="taskExecutor" /> 
     </batch:partition> 
</batch:step> 

は、ファイルのJVM引数またはスプリングapplication.propertiesからグリッドサイズを割り当てることができ、このですか?

答えて

1

グリッドサイズの値を次のように変更してください。コマンドラインからアプリケーションを起動するときは、コマンドに--grid.size=10を追加してください。

<batch:step id="master"> 
     <batch:partition step="slave" partitioner="rangePartitioner"> 
     <batch:handler grid-size="${grid.size}" task-executor="taskExecutor" /> 
     </batch:partition> 
</batch:step> 
+0

ありがとうございます@mhshimul –