Example usage for org.springframework.batch.integration.partition MessageChannelPartitionHandler setGridSize

List of usage examples for org.springframework.batch.integration.partition MessageChannelPartitionHandler setGridSize

Introduction

In this page you can find the example usage for org.springframework.batch.integration.partition MessageChannelPartitionHandler setGridSize.

Prototype

public void setGridSize(int gridSize) 

Source Link

Document

Passed to the StepExecutionSplitter in the #handle(StepExecutionSplitter,StepExecution) method, instructing it how many StepExecution instances are required, ideally.

Usage

From source file:uk.ac.kcl.batch.RemoteConfiguration.java

@Bean
@Qualifier("partitionHandler")
public MessageChannelPartitionHandler partitionHandler(@Qualifier("requestChannel") MessageChannel reqChannel,
        @Qualifier("aggregatedReplyChannel") PollableChannel repChannel) {
    MessageChannelPartitionHandler handler = new MessageChannelPartitionHandler();
    handler.setGridSize(gridSize);
    handler.setStepName("compositeSlaveStep");
    handler.setReplyChannel(repChannel);
    MessagingTemplate template = new MessagingTemplate();
    template.setDefaultChannel(reqChannel);
    template.setReceiveTimeout(partitionHandlerTimeout);
    handler.setMessagingOperations(template);
    return handler;
}

From source file:com.apress.prospringintegration.springbatch.partition.PartitionConfiguration.java

@Bean
public MessageChannelPartitionHandler partitionHandler() {
    MessageChannelPartitionHandler partitionHandler = new MessageChannelPartitionHandler();
    partitionHandler.setMessagingOperations(messagingTemplate());
    partitionHandler.setReplyChannel(pollableChannel);
    partitionHandler.setStepName("step1");
    partitionHandler.setGridSize(10);
    return partitionHandler;
}

From source file:io.spring.batch.configuration.JobConfiguration.java

@Bean
public PartitionHandler partitionHandler() throws Exception {
    MessageChannelPartitionHandler partitionHandler = new MessageChannelPartitionHandler();

    partitionHandler.setStepName("slaveStep");
    partitionHandler.setGridSize(GRID_SIZE);
    partitionHandler.setMessagingOperations(messageTemplate());
    partitionHandler.setPollInterval(5000l);
    partitionHandler.setJobExplorer(this.jobExplorer);

    partitionHandler.afterPropertiesSet();

    return partitionHandler;
}