Skip to main content

MQConsumerInner

Trait MQConsumerInner 

Source
pub trait MQConsumerInner:
    MQConsumerInnerAny
    + Sync
    + 'static
    + Send {
Show 14 methods // Required methods fn group_name(&self) -> CheetahString; fn message_model(&self) -> MessageModel; fn consume_type(&self) -> ConsumeType; fn consume_from_where(&self) -> ConsumeFromWhere; fn subscriptions(&self) -> HashSet<SubscriptionData>; fn do_rebalance(&self) -> impl Future<Output = ()> + Send; fn try_rebalance(&self) -> impl Future<Output = ClientResult<bool>> + Send; fn persist_consumer_offset(&self) -> impl Future<Output = ()> + Send; fn update_topic_subscribe_info( &self, topic: CheetahString, info: &HashSet<MessageQueue>, ) -> impl Future<Output = ()> + Send; fn is_subscribe_topic_need_update( &self, topic: &str, ) -> impl Future<Output = bool> + Send; fn is_unit_mode(&self) -> bool; fn reset_offsets( &self, topic: &CheetahString, offsets: HashMap<MessageQueue, i64>, ) -> impl Future<Output = ()> + Send; fn consumer_status( &self, topic: &CheetahString, ) -> impl Future<Output = HashMap<MessageQueue, i64>> + Send; fn consumer_running_info( &self, ) -> impl Future<Output = ConsumerRunningInfo> + Send;
}
Expand description

The MQConsumerInnerLocal trait defines the core functionalities required for a local MQ consumer. It extends the MQConsumerInnerAny trait and requires implementations to be Sync and 'static.

Required Methods§

Source

fn group_name(&self) -> CheetahString

Returns the group name of the consumer.

Source

fn message_model(&self) -> MessageModel

Returns the message model used by the consumer.

Source

fn consume_type(&self) -> ConsumeType

Returns the type of consumption (e.g., push or pull).

Source

fn consume_from_where(&self) -> ConsumeFromWhere

Returns the point from where the consumer should start consuming messages.

Source

fn subscriptions(&self) -> HashSet<SubscriptionData>

Returns the set of subscriptions for the consumer.

Source

fn do_rebalance(&self) -> impl Future<Output = ()> + Send

Performs the rebalancing of the consumer.

Source

fn try_rebalance(&self) -> impl Future<Output = ClientResult<bool>> + Send

Attempts to perform rebalancing asynchronously and returns a Result indicating success or failure.

Source

fn persist_consumer_offset(&self) -> impl Future<Output = ()> + Send

Persists the consumer offset asynchronously.

Source

fn update_topic_subscribe_info( &self, topic: CheetahString, info: &HashSet<MessageQueue>, ) -> impl Future<Output = ()> + Send

Updates the subscription information for a given topic asynchronously.

§Arguments
  • topic - A string slice that holds the name of the topic.
  • info - A reference to a HashSet containing MessageQueue information.
Source

fn is_subscribe_topic_need_update( &self, topic: &str, ) -> impl Future<Output = bool> + Send

Checks if the subscription information for a given topic needs to be updated asynchronously.

§Arguments
  • topic - A string slice that holds the name of the topic.
§Returns
  • bool - true if the subscription information needs to be updated, false otherwise.
Source

fn is_unit_mode(&self) -> bool

Returns whether the consumer is in unit mode.

Source

fn reset_offsets( &self, topic: &CheetahString, offsets: HashMap<MessageQueue, i64>, ) -> impl Future<Output = ()> + Send

Replaces the in-memory offsets for queues belonging to the given topic.

Source

fn consumer_status( &self, topic: &CheetahString, ) -> impl Future<Output = HashMap<MessageQueue, i64>> + Send

Returns a snapshot of the consumer offsets for the given topic.

Source

fn consumer_running_info( &self, ) -> impl Future<Output = ConsumerRunningInfo> + Send

Returns the running information of the consumer.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§