diff --git a/include/CMessageExt.h b/include/CMessageExt.h index ae216e08e..818ee726f 100644 --- a/include/CMessageExt.h +++ b/include/CMessageExt.h @@ -43,6 +43,8 @@ ROCKETMQCLIENT_API long long GetMessageStoreTimestamp(CMessageExt* msgExt); ROCKETMQCLIENT_API long long GetMessageQueueOffset(CMessageExt* msgExt); ROCKETMQCLIENT_API long long GetMessageCommitLogOffset(CMessageExt* msgExt); ROCKETMQCLIENT_API long long GetMessagePreparedTransactionOffset(CMessageExt* msgExt); +ROCKETMQCLIENT_API const char* GetMessageStoreHost(CMessageExt* msg); +ROCKETMQCLIENT_API const char* GetMessageBornHost(CMessageExt* msg); #ifdef __cplusplus } diff --git a/src/extern/CMessageExt.cpp b/src/extern/CMessageExt.cpp index 45da289e5..a85a27d12 100644 --- a/src/extern/CMessageExt.cpp +++ b/src/extern/CMessageExt.cpp @@ -130,6 +130,20 @@ long long GetMessagePreparedTransactionOffset(CMessageExt* msg) { } return ((MQMessageExt*)msg)->getPreparedTransactionOffset(); } + +const char* GetMessageStoreHost(CMessageExt* msg) { + if (msg == NULL) { + return NULL; + } + return ((MQMessageExt*) msg)->getStoreHostString().c_str(); +} + +const char* GetMessageBornHost(CMessageExt* msg) { + if (msg == NULL) { + return NULL; + } + return ((MQMessageExt*) msg)->getBornHostString().c_str(); +} #ifdef __cplusplus }; #endif