BATCH-2283: Updated MessageChannelPartitionHandler to return null when no partitions are specified

This commit is contained in:
Michael Minella
2014-08-06 14:52:02 -05:00
parent 587680ba56
commit deb4c6fb5b
7 changed files with 46 additions and 12 deletions

View File

@@ -32,7 +32,7 @@ public class AsyncItemWriter<T> implements ItemWriter<Future<T>>, InitializingBe
}
/**
* @param delegate
* @param delegate ItemWriter that does the actual writing of the Future results
*/
public void setDelegate(ItemWriter<T> delegate) {
this.delegate = delegate;

View File

@@ -31,8 +31,8 @@ public class JobLaunchRequest {
private final JobParameters jobParameters;
/**
* @param job
* @param jobParameters
* @param job job to be launched
* @param jobParameters parameters to run the job with
*/
public JobLaunchRequest(Job job, JobParameters jobParameters) {
super();

View File

@@ -57,7 +57,7 @@ public class JobLaunchingGateway extends AbstractReplyProducingMessageHandler {
* is a failure to start the job. The cause of the exception will be a
* {@link JobExecutionException}.
*
* @throws MessageHandlingException
* @throws MessageHandlingException when a job cannot be launched
*/
@Override
protected Object handleRequestMessage(Message<?> requestMessage) {

View File

@@ -35,7 +35,7 @@ public class JobLaunchingMessageHandler implements JobLaunchRequestHandler {
private final JobLauncher jobLauncher;
/**
* @param jobLauncher
* @param jobLauncher {@link org.springframework.batch.core.launch.JobLauncher} used to execute Spring Batch jobs
*/
public JobLaunchingMessageHandler(JobLauncher jobLauncher) {
super();

View File

@@ -18,6 +18,7 @@ import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.PollableChannel;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import java.util.Collection;
import java.util.List;
@@ -119,6 +120,11 @@ public class MessageChannelPartitionHandler implements PartitionHandler {
StepExecution masterStepExecution) throws Exception {
Set<StepExecution> split = stepExecutionSplitter.split(masterStepExecution, gridSize);
if(CollectionUtils.isEmpty(split)) {
return null;
}
int count = 0;
if (replyChannel == null) {