pub trait MQAdmin {
// Required methods
fn create_topic(
&self,
key: &str,
new_topic: &str,
queue_num: i32,
attributes: HashMap<String, String>,
) -> RocketMQResult<()>;
fn create_topic_with_flag(
&self,
key: &str,
new_topic: &str,
queue_num: i32,
topic_sys_flag: i32,
attributes: HashMap<String, String>,
) -> RocketMQResult<()>;
fn search_offset(
&self,
mq: &MessageQueue,
timestamp: u64,
) -> RocketMQResult<i64>;
fn max_offset(&self, mq: &MessageQueue) -> RocketMQResult<i64>;
fn min_offset(&self, mq: &MessageQueue) -> RocketMQResult<i64>;
fn earliest_msg_store_time(&self, mq: &MessageQueue) -> RocketMQResult<u64>;
fn query_message(
&self,
topic: &str,
key: &str,
max_num: i32,
begin: u64,
end: u64,
) -> RocketMQResult<QueryResult>;
fn view_message(
&self,
topic: &str,
msg_id: &str,
) -> RocketMQResult<MessageExt>;
}
Expand description
Trait defining administrative operations for a Message Queue (MQ).
Required Methods§
Sourcefn create_topic(
&self,
key: &str,
new_topic: &str,
queue_num: i32,
attributes: HashMap<String, String>,
) -> RocketMQResult<()>
fn create_topic( &self, key: &str, new_topic: &str, queue_num: i32, attributes: HashMap<String, String>, ) -> RocketMQResult<()>
Sourcefn create_topic_with_flag(
&self,
key: &str,
new_topic: &str,
queue_num: i32,
topic_sys_flag: i32,
attributes: HashMap<String, String>,
) -> RocketMQResult<()>
fn create_topic_with_flag( &self, key: &str, new_topic: &str, queue_num: i32, topic_sys_flag: i32, attributes: HashMap<String, String>, ) -> RocketMQResult<()>
Creates a new topic with a system flag.
§Arguments
key
- A key used for topic creation.new_topic
- The name of the new topic.queue_num
- The number of queues for the new topic.topic_sys_flag
- The system flag for the new topic.attributes
- A map of attributes for the new topic.
§Returns
A Result
indicating success or failure.
Sourcefn search_offset(
&self,
mq: &MessageQueue,
timestamp: u64,
) -> RocketMQResult<i64>
fn search_offset( &self, mq: &MessageQueue, timestamp: u64, ) -> RocketMQResult<i64>
Sourcefn max_offset(&self, mq: &MessageQueue) -> RocketMQResult<i64>
fn max_offset(&self, mq: &MessageQueue) -> RocketMQResult<i64>
Sourcefn min_offset(&self, mq: &MessageQueue) -> RocketMQResult<i64>
fn min_offset(&self, mq: &MessageQueue) -> RocketMQResult<i64>
Sourcefn earliest_msg_store_time(&self, mq: &MessageQueue) -> RocketMQResult<u64>
fn earliest_msg_store_time(&self, mq: &MessageQueue) -> RocketMQResult<u64>
Sourcefn query_message(
&self,
topic: &str,
key: &str,
max_num: i32,
begin: u64,
end: u64,
) -> RocketMQResult<QueryResult>
fn query_message( &self, topic: &str, key: &str, max_num: i32, begin: u64, end: u64, ) -> RocketMQResult<QueryResult>
Queries messages in a topic by key within a time range.
§Arguments
topic
- The topic to query.key
- The key to search for.max_num
- The maximum number of messages to return.begin
- The start of the time range.end
- The end of the time range.
§Returns
A Result
containing a QueryResult
with the messages, or an error.