Class BaseBatchedLossyQueueConsumerConveyor<PK extends io.datarouter.model.key.primary.PrimaryKey<PK>,​D extends io.datarouter.model.databean.Databean<PK,​D>>

java.lang.Object
io.datarouter.conveyor.BaseConveyor
io.datarouter.conveyor.queue.BaseBatchedLossyQueueConsumerConveyor<PK,​D>
Type Parameters:
PK - Primary key
D - Databean
All Implemented Interfaces:
Conveyor, java.lang.Comparable<Conveyor>, java.lang.Runnable

public abstract class BaseBatchedLossyQueueConsumerConveyor<PK extends io.datarouter.model.key.primary.PrimaryKey<PK>,​D extends io.datarouter.model.databean.Databean<PK,​D>>
extends BaseConveyor
Drains the queue and stores the data in a buffer. When the buffer hits a set limit it will trigger the processing as a batch. This implementation makes the best effort to process the buffer if the queue gets drained or it has been interrupted. NOTE: If the thread running the conveyor is killed or crashes before the processing of the buffer is completed the messages are lost forever. Along side the conveyor there must be some backup implementation that re-queues messages that are lost.