Struct nakadion::components::connector::StreamParameters[][src]

pub struct StreamParameters {
    pub partitions: Vec<EventTypePartition, Global>,
    pub max_uncommitted_events: Option<StreamMaxUncommittedEvents>,
    pub batch_limit: Option<StreamBatchLimit>,
    pub stream_limit: Option<StreamLimit>,
    pub batch_flush_timeout_secs: Option<StreamBatchFlushTimeoutSecs>,
    pub batch_timespan_secs: Option<StreamBatchTimespanSecs>,
    pub stream_timeout_secs: Option<StreamTimeoutSecs>,
    pub commit_timeout_secs: Option<StreamCommitTimeoutSecs>,
}
Expand description

Parameters for starting a new stream on a subscription

See also Nakadi Manual

Environment

When initialized/updated from the environment the following environment variable are used which by are by default prefixed with “NAKADION_” or a custom prefix “_”:

  • “STREAM_MAX_UNCOMMITTED_EVENTS”
  • “STREAM_BATCH_LIMIT”
  • “STREAM_LIMIT”
  • “STREAM_BATCH_FLUSH_TIMEOUT_SECS”
  • “STREAM_BATCH_TIMESPAN_SECS”
  • “STREAM_TIMEOUT_SECS”
  • “STREAM_COMMIT_TIMEOUT_SECS”

Fields

partitions: Vec<EventTypePartition, Global>

List of partitions to read from in this stream. If absent or empty - then the partitions will be automatically assigned by Nakadi.

max_uncommitted_events: Option<StreamMaxUncommittedEvents>

The maximum number of uncommitted events that Nakadi will stream before pausing the stream. When in paused state and commit comes - the stream will resume.

batch_limit: Option<StreamBatchLimit>

Maximum number of Events in each chunk (and therefore per partition) of the stream.

stream_limit: Option<StreamLimit>

Maximum number of Events in this stream (over all partitions being streamed in this connection)

batch_flush_timeout_secs: Option<StreamBatchFlushTimeoutSecs>

Maximum time in seconds to wait for the flushing of each chunk (per partition).

batch_timespan_secs: Option<StreamBatchTimespanSecs>

Useful for batching events based on their received_at timestamp. For example, if batch_timespan is 5 seconds then Nakadi would flush a batch as soon as the difference in time between the first and the last event in the batch exceeds 5 seconds. It waits for an event outside of the window to signal the closure of a batch.

stream_timeout_secs: Option<StreamTimeoutSecs>

Maximum time in seconds a stream will live before connection is closed by the server.

If 0 or unspecified will stream for 1h ±10min.

commit_timeout_secs: Option<StreamCommitTimeoutSecs>

Maximum amount of seconds that Nakadi will be waiting for commit after sending a batch to a client. In case if 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. Setting commit_timeout to 0 is equal to setting it to the maximum allowed value - 60 seconds.

Implementations

Initializes all fields from environment variables prefixed with “NAKADION_”

Initializes all fields from environment variables prefixed with “[prefix]_”

The underscore is omitted if prefix is empty

Initializes all fields from environment variables without any prefix

Updates all not yet set fields from environment variables prefixed with “NAKADION_”

Updates all not yet set fields from environment variables without any prefix

Updates all not yet set fields from environment variables prefixed with “[prefix]_”

The underscore is omitted if prefix is empty

List of partitions to read from in this stream. If absent or empty - then the partitions will be automatically assigned by Nakadi.

The maximum number of uncommitted events that Nakadi will stream before pausing the stream.

When in paused state and commit comes - the stream will resume.

Maximum number of Events in each chunk (and therefore per partition) of the stream.

Maximum number of Events in this stream (over all partitions being streamed in this connection)

Maximum time in seconds to wait for the flushing of each chunk (per partition).

Useful for batching events based on their received_at timestamp.

For example, if batch_timespan is 5 seconds then Nakadi would flush a batch as soon as the difference in time between the first and the last event in the batch exceeds 5 seconds. It waits for an event outside of the window to signal the closure of a batch.

Maximum time in seconds a stream will live before connection is closed by the server..

Maximum amount of seconds that Nakadi will be waiting for commit after sending a batch to a client.

In case if 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. Setting commit_timeout to 0 is equal to setting it to the maximum allowed value - 60 seconds.

Returns the configured value or the Nakadi default

Returns the configured value or the Nakadi default

Returns the configured value or the Nakadi default

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more