[][src]Module nakadion::consumer

Kit for creating a consumer for a subscription

Start here if you want to consume a stream. You will need a BatchHandlerFactory to consume a stream.

Re-exports

pub use crate::instrumentation::Instrumentation;
pub use crate::instrumentation::MetricsDetailLevel;

Structs

AbortConnectOnAuthError

If true abort the consumer when an auth error occurs while connecting to a stream.

AbortConnectOnSubscriptionNotFound

If true abort the consumer when a subscription does not exist when connection to a stream.

BatchFlushTimeoutSecs

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

BatchLimit

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

BatchTimespanSecs

Useful for batching events based on their received_at timestamp.

Builder

Creates a Consumer

CommitAttemptTimeoutMillis

The timeout for a request made to Nakadi to commit cursors.

CommitRetryDelayMillis

The delay between failed attempts to commit cursors.

ConnectStreamRetryMaxDelaySecs

The maximum retry delay between failed attempts to connect to a stream.

ConnectStreamTimeoutSecs

The timeout for a request made to Nakadi to connect to a stream.

Consumer

Consumes an event stream

ConsumerError

Always leads to Nakadion shutting down

ConsumerHandle

A handle for controlling a Consumer from externally.

Consuming

A Future that completes once the consumer stopped events consumption

ConsumptionOutcome

Returned once a Consumer has stopped. It contains the original consumer and if the Consumer was stopped for other reasons than the stream ending a ConsumerError.

DevNullLogger

Does no logging at all

Error

An error for cases where further investigation is not necessary

HandlerInactivityTimeoutSecs

The time after which a handler is considered inactive.

LogLogger

A logger based on log

MaxConnectAttempts

The maximum number of attempts to be made to connect to a stream.

MaxUncommittedEvents

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

Metrix

Instrumentation with Metrix

MetrixConfig
PartitionInactivityTimeoutSecs

The time after which a partition is considered inactive.

SlogLogger

A logger based on slog

StdErrLogger

Logs to stderr

StdOutLogger

Logs to stdout

StreamLimit

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

StreamParameters

Parameters for starting a new stream on a subscription

StreamTimeoutSecs

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

SubscriptionId

Id of a subscription

TickIntervalMillis

The internal tick interval.

WarnStreamStalledSecs

Emits a warning when no lines were received from Nakadi.

Enums

CommitStrategy

Defines how to commit cursors

ConsumerErrorKind
DispatchMode

Defines how to dispatch batches to handlers.

StreamDeadPolicy

Specifies when a stream is considered dead and has to be aborted.

Traits

LoggingAdapter

An adapter for pluggable logging.