diff --git a/spring-cloud-task-docs/src/main/asciidoc/batch.adoc b/spring-cloud-task-docs/src/main/asciidoc/batch.adoc index 17f48a0c..512e04f6 100644 --- a/spring-cloud-task-docs/src/main/asciidoc/batch.adoc +++ b/spring-cloud-task-docs/src/main/asciidoc/batch.adoc @@ -80,8 +80,10 @@ public PartitionHandler partitionHandler(TaskLauncher taskLauncher, Map environmentProperties = new HashMap<>(); environmentProperties.put("spring.profiles.active", "worker"); + SimpleEnvironmentVariablesProvider environmentVariablesProvider = new SimpleEnvironmentVariablesProvider(this.environment); + environmentVariablesProvider.setEnvironmentProperties(environmentProperties); + partitionHandler.setEnvironmentVariablesProvider(environmentVariablesProvider); - partitionHandler.setEnvironmentProperties(environmentProperties); partitionHandler.setMaxWorkers(2); return partitionHandler; @@ -107,6 +109,20 @@ public DeployerStepExecutionHandler stepExecutionHandler(JobExplorer jobExplorer } ``` +=== Notes on developing a batch partitioned app for the Yarn platform + +* When deploying partitioned apps on the Yarn platform be sure use the following dependency for the +Spring Cloud Yarn Deployer: +``` + + org.springframework.cloud + spring-cloud-starter-deployer-yarn + +``` +* Also add the following property to your application.properties: `spring.yarn.container.keepContextAlive=false`. +* When setting up environment variables for the partitions in the PartitionHandler it is recommended that you do not +copy the current working environment properties. + [[batch-informational-messages]] == Batch Informational Messages