Struct nakadion::NakadionBuilder[][src]

pub struct NakadionBuilder {
    pub streaming_client_builder: ConfigBuilder,
    pub request_timeout: Option<Duration>,
    pub commit_strategy: Option<CommitStrategy>,
    pub subscription_discovery: Option<SubscriptionDiscovery>,
    pub min_idle_worker_lifetime: Option<Duration>,
}

Build a NakadionConfig or directly build and start Nakadion

Fields

The configuration of the streaming client used to connect to the stream.

The defaults are defaults of streaming_client::ConfigBuilder

The request timeout used when committing events

The CommitStrategy to use for committing cursors

Used for discovering/creating the subscription to consume

The time after which a worker that received no events will be shut down. The default is to never shut down workers.

Methods

impl NakadionBuilder
[src]

Maximum number of empty keep alive batches to get in a row before closing the connection. If 0 or undefined will send keep alive messages indefinitely.

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

  • If 0 or undefined, will stream batches indefinitely.
  • Stream initialization will fail if stream_limit is lower than batch_limit.

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. Stream initialization will fail if stream_timeout is lower than batch_flush_timeout.

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

  • 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.

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

  • If 0 or unspecified will buffer Events indefinitely and flush on reaching of batch_flush_timeout.

The amount of uncommitted events Nakadi will stream before pausing the stream. When in paused state and commit comes - the stream will resume. Minimal value is 1.

When using the concurrent worker you should adjust this value to safe your workers from running dry.

The URI prefix for the Nakadi Host, e.g. "https://my.nakadi.com"

The request timeout used when committing events

The time after which a worker that received no events will be shut down. The default is to never shut down workers.

Create a new builder from environment variables.

Environment Variables:

  • NAKADION_NAKADI_HOST: See NakadionBuilder::nakadi_host
  • NAKADION_MAX_UNCOMMITED_EVENTS: See NakadionBuilder::max_uncommitted_events
  • NAKADION_BATCH_LIMIT: See NakadionBuilder::batch_limit
  • NAKADION_BATCH_FLUSH_TIMEOUT_SECS: See NakadionBuilder::batch_flush_timeout
  • NAKADION_STREAM_TIMEOUT_SECS: See NakadionBuilder::stream_timeout
  • NAKADION_STREAM_LIMIT: See NakadionBuilder::stream_limit
  • NAKADION_STREAM_KEEP_ALIVE_LIMIT´: SeeNakadionBuilder::stream_keep_alive_limit`
  • NAKADION_REQUEST_TIMEOUT_MS: See NakadionBuilder::request_timeout
  • NAKADION_COMMIT_STRATEGY: See NakadionBuilder::commit_strategy. Value must be the JSON representation of a CommitStrategy.
  • NAKADION_SUBSCRIPTION_DISCOVERY: See NakadionBuilder::subscription_discovery. Value must be the JSON representation of a SubscriptionDiscovery.
  • NAKADION_MIN_IDLE_WORKER_LIFETIME_SECS: See NakadionBuilder::min_idle_worker_lifetime

Errors

A value from an existing environment variable was not parsable

Build a NakadionConfig from this builder

Errors

Not all mandatory values have been set

Build and start Nakadion from this builder

No metrics will be collected.

Errors

Not all mandatory values have been set or creating Nakadion failed.

Build and start Nakadion from this builder

The given MetricsCollector will be used to collect metrics

Errors

Not all mandatory values have been set or creating Nakadion failed.

Trait Implementations

impl Default for NakadionBuilder
[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations