diff --git a/rocketmq-common/src/common/message.rs b/rocketmq-common/src/common/message.rs index 6261cb680..bc6ac1158 100644 --- a/rocketmq-common/src/common/message.rs +++ b/rocketmq-common/src/common/message.rs @@ -205,6 +205,11 @@ pub trait MessageTrait: Any + Display + Debug { self.property(&CheetahString::from_static_str(MessageConst::PROPERTY_BUYER_ID)) } + /// Returns a reference to the buyer ID associated with the message. + fn buyer_id_ref(&self) -> Option<&CheetahString> { + self.property_ref(&CheetahString::from_static_str(MessageConst::PROPERTY_BUYER_ID)) + } + /// Sets the buyer ID for the message. fn set_buyer_id(&mut self, buyer_id: CheetahString) { self.put_property(