KafkaInputConfig

Struct KafkaInputConfig 

Source
pub struct KafkaInputConfig {
    pub kafka_options: BTreeMap<String, String>,
    pub topic: String,
    pub log_level: Option<KafkaLogLevel>,
    pub group_join_timeout_secs: u32,
    pub poller_threads: Option<usize>,
    pub start_from: KafkaStartFromConfig,
    pub region: Option<String>,
    pub partitions: Option<Vec<i32>>,
    pub resume_earliest_if_data_expires: bool,
}
Expand description

Configuration for reading data from Kafka topics with InputTransport.

Fields§

§kafka_options: BTreeMap<String, String>

Options passed directly to rdkafka.

librdkafka options used to configure the Kafka consumer.

This input connector does not use consumer groups, so options related to consumer groups are rejected, including:

  • group.id, if present, is ignored.
  • auto.offset.reset (use start_from instead).
  • “enable.auto.commit”, if present, must be set to “false”.
  • “enable.auto.offset.store”, if present, must be set to “false”.
§topic: String

Topic to subscribe to.

§log_level: Option<KafkaLogLevel>

The log level of the client.

If not specified, the log level will be calculated based on the global log level of the log crate.

§group_join_timeout_secs: u32

Maximum timeout in seconds to wait for the endpoint to join the Kafka consumer group during initialization.

§poller_threads: Option<usize>

Set to 1 or more to fix the number of threads used to poll rdkafka. Multiple threads can increase performance with small Kafka messages; for large messages, one thread is enough. In either case, too many threads can harm performance. If unset, the default is 3, which helps with small messages but will not harm performance with large messagee

§start_from: KafkaStartFromConfig

Where to begin reading the topic.

§region: Option<String>

The AWS region to use while connecting to AWS Managed Streaming for Kafka (MSK).

§partitions: Option<Vec<i32>>

The list of Kafka partitions to read from.

Only the specified partitions will be consumed. If this field is not set, the connector will consume from all available partitions.

If start_from is set to offsets and this field is provided, the number of partitions must exactly match the number of offsets, and the order of partitions must correspond to the order of offsets.

If offsets are provided for all partitions, this field can be omitted.

§resume_earliest_if_data_expires: bool

By default, if the input connector resumes from a checkpoint and the data where it needs to resume has expired from the Kafka topic, the input connector fails initialization and the pipeline will fail to start.

Set this to true to change the behavior so that, if data is not available on resume, the input connector starts from the earliest offsets that are now available.

Implementations§

Source§

impl KafkaInputConfig

Source

pub fn poller_threads(&self) -> usize

Source§

impl KafkaInputConfig

Source

pub fn validate(&mut self) -> AnyResult<()>

Validate configuration, set default option values required by this adapter.

Trait Implementations§

Source§

impl Clone for KafkaInputConfig

Source§

fn clone(&self) -> KafkaInputConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for KafkaInputConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for KafkaInputConfig

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for KafkaInputConfig

Source§

fn eq(&self, other: &KafkaInputConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for KafkaInputConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'__s> ToSchema<'__s> for KafkaInputConfig

Source§

fn schema() -> (&'__s str, RefOr<Schema>)

Return a tuple of name and schema or reference to a schema that can be referenced by the name or inlined directly to responses, request bodies or parameters.
Source§

fn aliases() -> Vec<(&'__s str, Schema)>

Optional set of alias schemas for the ToSchema::schema. Read more
Source§

impl Eq for KafkaInputConfig

Source§

impl StructuralPartialEq for KafkaInputConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,