Package org.zalando.fahrschein
Class StreamParameters
java.lang.Object
org.zalando.fahrschein.StreamParameters
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionwithBatchFlushTimeout(int batchFlushTimeout) Maximum time in seconds to wait for the flushing of each chunk (per partition).withBatchLimit(int batchLimit) Maximum number of Events in each chunk (and therefore per partition) of the stream.withCommitTimeout(int commitTimeout) Maximum amount of seconds that nakadi will be waiting for commit after sending a batch to a client.withMaxUncommittedEvents(int maxUncommittedEvents) withStreamKeepAliveLimit(int streamKeepAliveLimit) Maximum number of empty keep alive batches to get in a row before closing the connection.withStreamLimit(int streamLimit) Maximum number of Events in this stream (over all partitions being streamed in this connection).withStreamTimeout(int streamTimeout) Maximum time in seconds a stream will live before connection is closed by the server.
-
Constructor Details
-
StreamParameters
public StreamParameters()
-
-
Method Details
-
withBatchLimit
Maximum number of Events in each chunk (and therefore per partition) of the stream.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.- Parameters:
batchLimit- batch_limit must be lower or equal to stream_limit- Throws:
IllegalArgumentException
-
withStreamLimit
Maximum number of Events in this stream (over all partitions being streamed in this connection).- Parameters:
streamLimit- If 0 or undefined, will stream batches indefinitely. Stream initialization will fail if stream_limit is lower than batch_limit.- Throws:
IllegalArgumentException
-
withBatchFlushTimeout
public StreamParameters withBatchFlushTimeout(int batchFlushTimeout) throws IllegalArgumentException Maximum time in seconds to wait for the flushing of each chunk (per partition).- Parameters:
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.- Throws:
IllegalArgumentException
-
withStreamTimeout
Maximum time in seconds a stream will live before connection is closed by the server. If 0 or unspecified will stream indefinitely. If this timeout is reached, any pending messages (in the sense of stream_limit) will be flushed to the client.- Parameters:
streamTimeout- Stream initialization will fail if stream_timeout is lower than batch_flush_timeout- Throws:
IllegalArgumentException
-
withCommitTimeout
Maximum amount of seconds that nakadi will be waiting for commit after sending a batch to a client. If the commit does not come within this timeout, nakadi will initialize stream termination, no new data will be sent. Partitions from this stream will be assigned to other streams.- Parameters:
commitTimeout-
-
withStreamKeepAliveLimit
Maximum number of empty keep alive batches to get in a row before closing the connection.- Parameters:
streamKeepAliveLimit- If 0 or undefined will send keep alive messages indefinitely.
-
withMaxUncommittedEvents
-
getBatchLimit
-
getStreamLimit
-
getBatchFlushTimeout
-
getStreamTimeout
-
getStreamKeepAliveLimit
-
getMaxUncommittedEvents
-
getCommitTimeout
-