You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by di...@apache.org on 2019/08/21 03:15:34 UTC
[rocketmq-ons-cpp] branch master updated: Fix group is set error if
producer id not set (#8)
This is an automated email from the ASF dual-hosted git repository.
dinglei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-ons-cpp.git
The following commit(s) were added to refs/heads/master by this push:
new 04530e2 Fix group is set error if producer id not set (#8)
04530e2 is described below
commit 04530e2e92bee0a48543dde82fec0bd0cef32857
Author: dinglei <li...@163.com>
AuthorDate: Wed Aug 21 11:15:30 2019 +0800
Fix group is set error if producer id not set (#8)
---
src/main/cpp/sdk/common/UtilAll.cpp | 2 +-
src/test/c/CPushConsumerTest.cpp | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/main/cpp/sdk/common/UtilAll.cpp b/src/main/cpp/sdk/common/UtilAll.cpp
index 9a4fc59..55de74f 100644
--- a/src/main/cpp/sdk/common/UtilAll.cpp
+++ b/src/main/cpp/sdk/common/UtilAll.cpp
@@ -46,7 +46,7 @@ void UtilAll::init_factory_property(const ons::ONSFactoryProperty &factoryProper
memset(&fp, 0, sizeof(factory_property));
string groupID(factoryProperty.getGroupId());
if (!groupID.empty()) {
- fp.group_id = const_cast<char *>(factoryProperty.getProducerId());
+ fp.group_id = const_cast<char *>(factoryProperty.getGroupId());
} else {
if (is_producer) {
fp.group_id = const_cast<char *>(factoryProperty.getProducerId());
diff --git a/src/test/c/CPushConsumerTest.cpp b/src/test/c/CPushConsumerTest.cpp
index 9926785..df7cf82 100644
--- a/src/test/c/CPushConsumerTest.cpp
+++ b/src/test/c/CPushConsumerTest.cpp
@@ -19,7 +19,7 @@ protected:
void SetUp() override {
consumer_ = CreatePushConsumer("GID_opensource_unit_test");
SetPushConsumerNameServerAddress(consumer_, "47.100.33.127:9876");
- SetPushConsumerSessionCredentials(consumer_, "AK", "SK", "LOCAL");
+ //SetPushConsumerSessionCredentials(consumer_, "AK", "SK", "LOCAL");
//StartPushConsumer(consumer_);
}
@@ -41,6 +41,7 @@ TEST_F(CPushConsumerTest, test_ConsumeMessage) {
RegisterMessageCallback(consumer_,onMessages);
StartPushConsumer(consumer_);
std::this_thread::sleep_for(std::chrono::milliseconds(10 * 1000));
+ ShutdownPushConsumer(consumer_);
ASSERT_TRUE(nullptr != consumer_);
}