pub struct TaskWorkerConfig {
pub brokers: String,
pub group_id: String,
pub scan_interval_secs: u64,
pub max_batch_size: usize,
pub max_message_age_secs: u64,
pub auto_create_topics: bool,
pub topic_partitions: i32,
pub topic_replication: i16,
}Expand description
TaskWorker 运行时配置(可从配置文件 [task] section 反序列化)
Fields§
§brokers: StringKafka broker 地址
group_id: String消费组 ID
scan_interval_secs: u64重试扫描间隔(秒)
max_batch_size: usize每批次扫描最大任务数
max_message_age_secs: u64消息最大时效(秒),超过此时间的消息将被跳过
auto_create_topics: bool是否在启动时自动创建 topic
topic_partitions: i32topic 分区数(auto_create_topics 时使用)
topic_replication: i16topic 副本数(auto_create_topics 时使用)
Trait Implementations§
Source§impl Clone for TaskWorkerConfig
impl Clone for TaskWorkerConfig
Source§fn clone(&self) -> TaskWorkerConfig
fn clone(&self) -> TaskWorkerConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TaskWorkerConfig
impl Debug for TaskWorkerConfig
Source§impl Default for TaskWorkerConfig
impl Default for TaskWorkerConfig
Source§impl<'de> Deserialize<'de> for TaskWorkerConfig
impl<'de> Deserialize<'de> for TaskWorkerConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TaskWorkerConfig
impl RefUnwindSafe for TaskWorkerConfig
impl Send for TaskWorkerConfig
impl Sync for TaskWorkerConfig
impl Unpin for TaskWorkerConfig
impl UnsafeUnpin for TaskWorkerConfig
impl UnwindSafe for TaskWorkerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more