pub struct MessageEnvelope { /* private fields */ }Expand description
Complete message envelope (stored message)
Represents a message that has been received and stored by the Broker, containing complete lifecycle information.
§Use Cases
- Consumer receiving messages
- Message query and tracking
- Message passing between Broker internal modules
Implementations§
Source§impl MessageEnvelope
impl MessageEnvelope
Sourcepub fn new(
message: Message,
routing: RoutingContext,
storage: StorageMetadata,
msg_id: CheetahString,
body_crc: u32,
reconsume_times: i32,
prepared_transaction_offset: i64,
) -> Self
pub fn new( message: Message, routing: RoutingContext, storage: StorageMetadata, msg_id: CheetahString, body_crc: u32, reconsume_times: i32, prepared_transaction_offset: i64, ) -> Self
Creates a new message envelope
Sourcepub fn message_mut(&mut self) -> &mut Message
pub fn message_mut(&mut self) -> &mut Message
Gets the mutable message reference
Sourcepub fn topic(&self) -> &CheetahString
pub fn topic(&self) -> &CheetahString
Gets the message topic
Sourcepub fn properties(&self) -> &HashMap<CheetahString, CheetahString>
pub fn properties(&self) -> &HashMap<CheetahString, CheetahString>
Gets the message properties
Gets the message tags
Sourcepub fn routing(&self) -> &RoutingContext
pub fn routing(&self) -> &RoutingContext
Gets the routing context
Sourcepub fn born_host(&self) -> SocketAddr
pub fn born_host(&self) -> SocketAddr
Gets the message sender’s client address
Sourcepub fn born_timestamp(&self) -> i64
pub fn born_timestamp(&self) -> i64
Gets the message creation timestamp
Sourcepub fn born_host_bytes(&self) -> Bytes
pub fn born_host_bytes(&self) -> Bytes
Gets the born host bytes
Sourcepub fn storage(&self) -> &StorageMetadata
pub fn storage(&self) -> &StorageMetadata
Gets the storage metadata
Sourcepub fn broker_name(&self) -> &str
pub fn broker_name(&self) -> &str
Gets the broker name
Sourcepub fn queue_offset(&self) -> i64
pub fn queue_offset(&self) -> i64
Gets the queue logical offset
Sourcepub fn commit_log_offset(&self) -> i64
pub fn commit_log_offset(&self) -> i64
Gets the CommitLog physical offset
Sourcepub fn store_timestamp(&self) -> i64
pub fn store_timestamp(&self) -> i64
Gets the storage timestamp
Sourcepub fn store_host(&self) -> SocketAddr
pub fn store_host(&self) -> SocketAddr
Gets the storage host address
Sourcepub fn store_size(&self) -> i32
pub fn store_size(&self) -> i32
Gets the storage size in bytes
Sourcepub fn store_host_bytes(&self) -> Bytes
pub fn store_host_bytes(&self) -> Bytes
Gets the store host bytes
Sourcepub fn msg_id(&self) -> &CheetahString
pub fn msg_id(&self) -> &CheetahString
Gets the message ID (offset-based)
Sourcepub fn client_msg_id(&self) -> CheetahString
pub fn client_msg_id(&self) -> CheetahString
Gets the client message ID (UNIQ_ID preferred, otherwise returns offset msg_id)
This is the client-side message ID, preferring UNIQ_ID (globally unique)
Sourcepub fn reconsume_times(&self) -> i32
pub fn reconsume_times(&self) -> i32
Gets the reconsume times
Sourcepub fn prepared_transaction_offset(&self) -> i64
pub fn prepared_transaction_offset(&self) -> i64
Gets the prepared transaction offset