Class ChunkMessageChannelItemWriter<T>
java.lang.Object
org.springframework.batch.integration.chunk.ChunkMessageChannelItemWriter<T>
- All Implemented Interfaces:
StepExecutionListener,StepListener,StepContributionSource,org.springframework.batch.item.ItemStream,org.springframework.batch.item.ItemWriter<T>
public class ChunkMessageChannelItemWriter<T>
extends Object
implements StepExecutionListener, org.springframework.batch.item.ItemWriter<T>, org.springframework.batch.item.ItemStream, StepContributionSource
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionafterStep(StepExecution stepExecution) voidbeforeStep(StepExecution stepExecution) voidclose()Get the currently available contributions and drain the source.voidopen(org.springframework.batch.item.ExecutionContext executionContext) voidsetMaxWaitTimeouts(int maxWaitTimeouts) The maximum number of times to wait at the end of a step for a non-null result from the remote workers.voidsetMessagingOperations(org.springframework.integration.core.MessagingTemplate messagingGateway) voidsetReplyChannel(org.springframework.messaging.PollableChannel replyChannel) voidsetThrottleLimit(long throttleLimit) Public setter for the throttle limit.voidupdate(org.springframework.batch.item.ExecutionContext executionContext) void
-
Constructor Details
-
ChunkMessageChannelItemWriter
public ChunkMessageChannelItemWriter()
-
-
Method Details
-
setMaxWaitTimeouts
public void setMaxWaitTimeouts(int maxWaitTimeouts) The maximum number of times to wait at the end of a step for a non-null result from the remote workers. This is a multiplier on the receive timeout set separately on the gateway. The ideal value is a compromise between allowing slow workers time to finish, and responsiveness if there is a dead worker. Defaults to 40.- Parameters:
maxWaitTimeouts- the maximum number of wait timeouts
-
setThrottleLimit
public void setThrottleLimit(long throttleLimit) Public setter for the throttle limit. This limits the number of pending requests for chunk processing to avoid overwhelming the receivers.- Parameters:
throttleLimit- the throttle limit to set
-
setMessagingOperations
public void setMessagingOperations(org.springframework.integration.core.MessagingTemplate messagingGateway) -
setReplyChannel
public void setReplyChannel(org.springframework.messaging.PollableChannel replyChannel) -
write
-
beforeStep
- Specified by:
beforeStepin interfaceStepExecutionListener
-
afterStep
- Specified by:
afterStepin interfaceStepExecutionListener
-
close
public void close() throws org.springframework.batch.item.ItemStreamException- Specified by:
closein interfaceorg.springframework.batch.item.ItemStream- Throws:
org.springframework.batch.item.ItemStreamException
-
open
public void open(org.springframework.batch.item.ExecutionContext executionContext) throws org.springframework.batch.item.ItemStreamException - Specified by:
openin interfaceorg.springframework.batch.item.ItemStream- Throws:
org.springframework.batch.item.ItemStreamException
-
update
public void update(org.springframework.batch.item.ExecutionContext executionContext) throws org.springframework.batch.item.ItemStreamException - Specified by:
updatein interfaceorg.springframework.batch.item.ItemStream- Throws:
org.springframework.batch.item.ItemStreamException
-
getStepContributions
Description copied from interface:StepContributionSourceGet the currently available contributions and drain the source. The next call would return an empty collection, unless new contributions have arrived.- Specified by:
getStepContributionsin interfaceStepContributionSource- Returns:
- a collection of
StepContributioninstances
-