Export send batch messages api in c style.#139
Export send batch messages api in c style.#139jonnxu merged 4 commits intoapache:masterfrom githublaohu:master
Conversation
include/CBatchMessage.h
Outdated
| typedef struct CBatchMessage CBatchMessage; | ||
|
|
||
| ROCKETMQCLIENT_API CBatchMessage* CreateBatchMessage(); | ||
| ROCKETMQCLIENT_API int addMessage(CBatchMessage* batchMsg, CMessage* msg); |
There was a problem hiding this comment.
rename with big camel-case.
There was a problem hiding this comment.
Already processed
|
|
||
| using std::vector; | ||
|
|
||
| #ifdef __cplusplus |
There was a problem hiding this comment.
this file is cpp, the if is unnecessary. and i think the extern is unnecessary too.
There was a problem hiding this comment.
This is the C interface and must be ifdef
这是c接口,必须ifdef
There was a problem hiding this comment.
这个肯定是要用c++编译器编译的,只要用了c++编译器,就一定会定义__cplusplus,所以你的说法是没道理的。
There was a problem hiding this comment.
c接口应该只要在声明的时候用extern “c”包起来就可以了,.cpp实现的时候没必要再次用extern c。
There was a problem hiding this comment.
其他extern实现类,都是这样实现的。如果需要进行整理,大家讨论下。
|
|
||
| int main(int argc, char* argv[]) { | ||
| printf("Send Batch.....\n"); | ||
| CreateProducerAndStartSendMessage(); |
There was a problem hiding this comment.
only call CreateProducerAndStartSendMessage in main, so i think the function is unnecessary.
There was a problem hiding this comment.
The code structure is clear and consistent with the C case in other examples, which is easy to understand.
代码结构清晰点,同时与其他example中c案例一致,便于理解
|
LGTM |
What is the purpose of the change
C batch sending interface
Brief changelog
Verifying this change
see example/CBatchProducer.c
Follow this checklist to help us incorporate your contribution quickly and easily. Notice,
it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.[ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.