Class BlockingQueueItemWriter<T>

java.lang.Object
org.springframework.batch.infrastructure.item.queue.BlockingQueueItemWriter<T>
Type Parameters:
T - type of items to write
All Implemented Interfaces:
ItemWriter<@NonNull T>

public class BlockingQueueItemWriter<T> extends Object implements ItemWriter<@NonNull T>
This is an ItemWriter that writes items to a BlockingQueue.
Since:
5.2.0
Author:
Mahmoud Ben Hassine
  • Constructor Details

  • Method Details

    • write

      public void write(Chunk<? extends @NonNull T> items) throws Exception
      Description copied from interface: ItemWriter
      Process the supplied data element. Will not be called with any null items in normal operation but might be called with an empty chunk, for example when all items have been filtered by an ItemProcessor or skipped by the fault-tolerant step processing. Implementations are expected to handle empty chunks gracefully.
      Specified by:
      write in interface ItemWriter<T>
      Parameters:
      items - of items to be written. Never null but may be empty.
      Throws:
      Exception - if there are errors. The framework will catch the exception and convert or rethrow it as appropriate.