public class StreamParameters extends Object
| Constructor and Description |
|---|
StreamParameters() |
| Modifier and Type | Method and Description |
|---|---|
Optional<Integer> |
getBatchFlushTimeout() |
Optional<Integer> |
getBatchLimit() |
Optional<Integer> |
getMaxUncommittedEvents() |
Optional<Integer> |
getStreamKeepAliveLimit() |
Optional<Integer> |
getStreamLimit() |
Optional<Integer> |
getStreamTimeout() |
StreamParameters |
withBatchFlushTimeout(int batchFlushTimeout)
Maximum time in seconds to wait for the flushing of each chunk (per partition).
|
StreamParameters |
withBatchLimit(int batchLimit)
Maximum number of Events in each chunk (and therefore per partition) of the stream.
|
StreamParameters |
withMaxUncommittedEvents(int maxUncommittedEvents) |
StreamParameters |
withStreamKeepAliveLimit(int streamKeepAliveLimit)
Maximum number of empty keep alive batches to get in a row before closing the connection.
|
StreamParameters |
withStreamLimit(int streamLimit)
Maximum number of Events in this stream (over all partitions being streamed in this connection).
|
StreamParameters |
withStreamTimeout(int streamTimeout)
Maximum time in seconds a stream will live before connection is closed by the server.
|
public StreamParameters withBatchLimit(int batchLimit) throws IllegalArgumentException
Note 2017/05/19: the API definition says if the value is 0 or unspecified the server will
buffer events indefinitely and flush on reaching of batchFlushTimeout.
This is incorrect - if the server receives a value of '0' it will not send events at
all (effectively it's a silent bug). Because of this if value is set to 0 (or less than 1)
client raise an exception.
batchLimit - batch_limit must be lower or equal to stream_limitIllegalArgumentExceptionpublic StreamParameters withStreamLimit(int streamLimit) throws IllegalArgumentException
streamLimit - If 0 or undefined, will stream batches indefinitely.
Stream initialization will fail if stream_limit is lower than batch_limit.IllegalArgumentExceptionpublic StreamParameters withBatchFlushTimeout(int batchFlushTimeout) throws IllegalArgumentException
batchFlushTimeout - If the amount of buffered Events reaches batch_limit before this batch_flush_timeout is reached,
the messages are immediately flushed to the client and batch flush timer is reset.
If 0 or undefined, will assume 30 seconds.IllegalArgumentExceptionpublic StreamParameters withStreamTimeout(int streamTimeout) throws IllegalArgumentException
streamTimeout - Stream initialization will fail if stream_timeout is lower than batch_flush_timeoutIllegalArgumentExceptionpublic StreamParameters withStreamKeepAliveLimit(int streamKeepAliveLimit)
streamKeepAliveLimit - If 0 or undefined will send keep alive messages indefinitely.public StreamParameters withMaxUncommittedEvents(int maxUncommittedEvents)
Copyright © 2016–2018 Zalando SE. All rights reserved.