In spring batch remote chunking, consider a situation where the worker consumers are not available. In that case the manager publishes number of items equal to the throttle limit and waits for the reply from the workers. I have the receiveTimeout
for the MessagingTemplate
set to 5000
. This loop from ChunkMessageChannelItemWriter
write()
is running infinitely because after every 5 seconds, the MessagingTemplate
receive()
timeout and returns null here. It doesn't perform anything if the result is null and thus falls into infinite loop.
In this scenario, the Job remains in an UNKNOWN
state. Is there any way to perform the timeout from the manager end if it doesn't get any reply from the workers for some amount of time and mark the job as failed?
You can set the
maxWaitTimeouts
on theChunkMessageChannelItemWriter
parameters for that.