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

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

Introduction

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

Prototype

public void setMessagingOperations(MessagingTemplate messagingGateway) 

Source Link

Document

A pre-configured gateway for sending and receiving messages to the remote workers.

Usage

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);/*w  ww  .jav  a  2s.c o m*/
    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;
}

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);/*from  ww  w. j av a 2s  .c  o m*/
    handler.setStepName("compositeSlaveStep");
    handler.setReplyChannel(repChannel);
    MessagingTemplate template = new MessagingTemplate();
    template.setDefaultChannel(reqChannel);
    template.setReceiveTimeout(partitionHandlerTimeout);
    handler.setMessagingOperations(template);
    return handler;
}