Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #483]feat: add get message store/born host c interface #484

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/CMessageExt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
14 changes: 14 additions & 0 deletions src/extern/CMessageExt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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