@Override
	public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {

		setOrchestrationId(chunkContext);

		String driverJobName = chunkContext.getStepContext().getStepExecution().getJobExecution().getJobInstance()
				.getJobName();

		bindChannels(driverJobName);

		try {
			validateJobDeployment();

			String jobParametersString = getJobParameters(chunkContext);

			logger.debug("Launching request for {} orchestration {}", this.jobName, this.orchestrationId);

			this.launchingChannel.send(MessageBuilder.withPayload(jobParametersString).build());

			Date startTime = new Date();

			long remaining = this.timeout;
			JobExecution results = null;
			while (results == null && (this.timeout > 0 ? remaining > 0 : true)) {
				Message<?> resultMessage = this.timeout > 0 ? this.listeningChannel.receive(remaining)
						: this.listeningChannel.receive();
				if (resultMessage != null) {
					results = getResult(resultMessage);
				}
				remaining = startTime.getTime() - System.currentTimeMillis() + this.timeout;
			}

			if (results != null) {
				processResult(contribution, chunkContext, results);
			}
			else {
				throw new UnexpectedJobExecutionException("The job timed out while waiting for a result");
			}

			logger.debug("Completed processing for {} orchestration {}", this.jobName, this.orchestrationId);

			return RepeatStatus.FINISHED;
		}
		finally {
			unbindChannels(driverJobName);
		}
	}
Uses the {@link MessageBus} to execute a job deployed in a Spring XD cluster.

@param contribution The contribution to the step's metrics.  Not used in this case
@param chunkContext Used to get a handle on the JobExecution and JobInstance
@return RepeatStatus.FINISHED
@throws Exception
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/batch/tasklet/JobLaunchingTasklet.java