rocketmq_client/message.rs
1//!
2//! Define Message struct. Application data are enveloped in `Message` before publishing to Apache RocketMQ.
3//!
4use bytes;
5use std::collections::HashMap;
6use std::vec::Vec;
7
8pub struct Message {
9 /// In the publisher-subscriber model, a topic is an addresses where messages are delivered to and subscribed from.
10 pub topic: String,
11
12 pub tag: String,
13
14 pub keys: Vec<String>,
15
16 /// User defined attributes in form of key-value paris.
17 /// Attributes are indexed by backend broker servers, thus, may be utilized to query.
18 pub attributes: HashMap<String, String>,
19
20 /// System properties
21 ///
22 /// System properties include key-value pairs to modify how messages are delivered to subscribers. For example, publishers
23 /// may publish a timed message, which should be invisible to subscribers before specified time point.
24 pub(crate) properties: HashMap<String, String>,
25
26 pub body: bytes::Bytes,
27}