From 0058bd8ac95475f40133a3e18688a2692b20d01c Mon Sep 17 00:00:00 2001 From: Hankunming <1109939087@qq.com> Date: Wed, 27 Nov 2024 10:06:47 +0800 Subject: [PATCH] feat: add get message store/born host c interface --- include/CMessageExt.h | 2 ++ src/extern/CMessageExt.cpp | 14 ++++++++++++++ 2 files changed, 16 insertions(+) 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