Interface BufferedBatchPublisher.Builder
- Enclosing class:
- BufferedBatchPublisher
public static interface BufferedBatchPublisher.Builder
Builder used to construct a new
BufferedBatchPublisher.-
Method Summary
Modifier and TypeMethodDescriptionautoFlush(boolean autoFlush) Whether events to should be automatically flushed on shutdown.averagePerEventPayloadSize(int averagePerEventPayloadSize) Sets the average event payload size, used to initialise string buffers.build()Constructs a newBatchPublisher.capacity(int capacity) Sets the maximum queue capacity.maxBatchEvents(int maxBatchedEvents) Sets the maximum number of events in a given batch.writeInterval(Duration writeInterval) The interval duration between each write.
-
Method Details
-
capacity
Sets the maximum queue capacity. Must be >= 10000.- Parameters:
capacity- queue capacity- Returns:
- this builder
-
maxBatchEvents
Sets the maximum number of events in a given batch. Must be >= 500.- Parameters:
maxBatchedEvents- maximum number of batched events- Returns:
- this builder
-
averagePerEventPayloadSize
Sets the average event payload size, used to initialise string buffers. Must be >= 32.- Parameters:
averagePerEventPayloadSize- average event payload size- Returns:
- this builder
-
writeInterval
The interval duration between each write. Must be > 0.- Parameters:
writeInterval- write interval- Returns:
- this builder
-
autoFlush
Whether events to should be automatically flushed on shutdown.- Parameters:
autoFlush- whether to auto flush- Returns:
- this builder
-
build
BatchPublisher build()Constructs a newBatchPublisher.- Returns:
- a new
BatchPublisher
-