Skip to main content

MQConsumer

Trait MQConsumer 

Source
pub trait MQConsumer {
    // Required methods
    async fn send_message_back(
        &mut self,
        msg: MessageExt,
        delay_level: i32,
        broker_name: &str,
    ) -> ClientResult<()>;
    async fn fetch_subscribe_message_queues(
        &mut self,
        topic: &str,
    ) -> ClientResult<Vec<MessageQueue>>;

    // Provided methods
    async fn create_topic(
        &mut self,
        _key: &str,
        _new_topic: &str,
        _queue_num: i32,
        _attributes: HashMap<String, String>,
    ) -> ClientResult<()> { ... }
    async fn create_topic_with_flag(
        &mut self,
        _key: &str,
        _new_topic: &str,
        _queue_num: i32,
        _topic_sys_flag: i32,
        _attributes: HashMap<String, String>,
    ) -> ClientResult<()> { ... }
    async fn search_offset(
        &mut self,
        _mq: &MessageQueue,
        _timestamp: u64,
    ) -> ClientResult<i64> { ... }
    async fn max_offset(&mut self, _mq: &MessageQueue) -> ClientResult<i64> { ... }
    async fn min_offset(&mut self, _mq: &MessageQueue) -> ClientResult<i64> { ... }
    async fn earliest_msg_store_time(
        &mut self,
        _mq: &MessageQueue,
    ) -> ClientResult<i64> { ... }
    async fn query_message(
        &mut self,
        _topic: &str,
        _key: &str,
        _max_num: i32,
        _begin: u64,
        _end: u64,
    ) -> ClientResult<QueryResult> { ... }
    async fn view_message(
        &mut self,
        _topic: &str,
        _msg_id: &str,
    ) -> ClientResult<MessageExt> { ... }
    async fn send_message_back_to_origin_broker(
        &mut self,
        msg: MessageExt,
        delay_level: i32,
    ) -> ClientResult<()> { ... }
}

Required Methods§

Source

async fn send_message_back( &mut self, msg: MessageExt, delay_level: i32, broker_name: &str, ) -> ClientResult<()>

Source

async fn fetch_subscribe_message_queues( &mut self, topic: &str, ) -> ClientResult<Vec<MessageQueue>>

Provided Methods§

Source

async fn create_topic( &mut self, _key: &str, _new_topic: &str, _queue_num: i32, _attributes: HashMap<String, String>, ) -> ClientResult<()>

Creates a topic through the consumer’s admin facade.

Java’s MQConsumer extends MQAdmin; Rust keeps these admin operations async because all broker I/O in this client is async.

Source

async fn create_topic_with_flag( &mut self, _key: &str, _new_topic: &str, _queue_num: i32, _topic_sys_flag: i32, _attributes: HashMap<String, String>, ) -> ClientResult<()>

Creates a topic with an explicit topic system flag.

Source

async fn search_offset( &mut self, _mq: &MessageQueue, _timestamp: u64, ) -> ClientResult<i64>

Searches the offset in a queue by store timestamp.

Source

async fn max_offset(&mut self, _mq: &MessageQueue) -> ClientResult<i64>

Returns the broker max offset for a queue.

Source

async fn min_offset(&mut self, _mq: &MessageQueue) -> ClientResult<i64>

Returns the broker min offset for a queue.

Source

async fn earliest_msg_store_time( &mut self, _mq: &MessageQueue, ) -> ClientResult<i64>

Returns the earliest store time for messages in a queue.

Source

async fn query_message( &mut self, _topic: &str, _key: &str, _max_num: i32, _begin: u64, _end: u64, ) -> ClientResult<QueryResult>

Queries messages by key in a time range.

Source

async fn view_message( &mut self, _topic: &str, _msg_id: &str, ) -> ClientResult<MessageExt>

Views a message by message id.

Source

async fn send_message_back_to_origin_broker( &mut self, msg: MessageExt, delay_level: i32, ) -> ClientResult<()>

Sends a message back using the broker name carried by the message.

This is the Rust equivalent of Java’s two-argument sendMessageBack(MessageExt, int) overload. Implementations may treat an empty broker name as Java null and fall back to the message store host.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§