Package org.springframework.batch.integration.chunk

# Interface ChunkHandler<T>

Type Parameters:
  `T` - the type of the items to be processed (it is recommended to use a Memento like a primary key)

All Known Implementing Classes:
  `ChunkProcessorChunkHandler`

public interface ChunkHandler<T>
Interface for a remote worker in the Remote Chunking pattern. A request comes from a manager process containing some items to be processed. Once the items are done with a response needs to be generated containing a summary of the result.

Author:
  Dave Syer

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ChunkResponse`
  `handleChunk(ChunkRequest<T> chunk)`
  Handle the chunk, processing all the items and returning a response summarising the result.

- ## Method Details

  - ### handleChunk

    ChunkResponse handleChunk(ChunkRequest<T> chunk) throws Exception
    Handle the chunk, processing all the items and returning a response summarising the result. If the result is a failure then the response should say so. The handler only throws an exception if it needs to roll back a transaction and knows that the request will be re-delivered (if not to the same handler then to one processing the same Step).
    Parameters:
      `chunk` - a request containing the chunk to process
    Returns:
      a response summarising the result
    Throws:
      `Exception` - if the handler needs to roll back a transaction and have the chunk re-delivered