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 #3332: fix httplookup issue for get ns/topics in cpp #3407
Conversation
rerun cpp tests failed for:
|
rerun cpp tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a couple of comments
@@ -310,18 +310,21 @@ LookupDataResultPtr HTTPLookupService::parseLookupData(const std::string &json) | |||
NamespaceTopicsPtr HTTPLookupService::parseNamespaceTopicsData(const std::string &json) { | |||
Json::Value root; | |||
Json::Reader reader; | |||
LOG_INFO("GetNamespaceTopics json = " << json); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be at debug level
@@ -1756,7 +1756,7 @@ TEST(BasicEndToEndTest, testPatternTopicsConsumerInvalid) { | |||
// verify PatternMultiTopicsConsumer subscribed matched topics, | |||
// and only receive messages from matched topics. | |||
TEST(BasicEndToEndTest, testPatternMultiTopicsConsumerPubSub) { | |||
Client client(lookupUrl); | |||
Client client(adminUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we should have the test fetching the lists of topic using both HTTP and protobuf.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, will add a new test.
@@ -310,18 +310,21 @@ LookupDataResultPtr HTTPLookupService::parseLookupData(const std::string &json) | |||
NamespaceTopicsPtr HTTPLookupService::parseNamespaceTopicsData(const std::string &json) { | |||
Json::Value root; | |||
Json::Reader reader; | |||
LOG_INFO("GetNamespaceTopics json = " << json); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: debug
rerun integration tests |
2 similar comments
rerun integration tests |
rerun integration tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Fixes #3332
Motivation
In http request to get ns/topics, it will return an array of topics,
But in cpp method
HTTPLookupService::parseNamespaceTopicsData
, it is expecting a json of itemlike:
{"topics": ["topic1", "topic2"] }
. This may be caused by the response format changes.Modifications
HTTPLookupService::parseNamespaceTopicsData
to following current http response data format.testPatternMultiTopicsConsumerPubSub
to use http adminUrl, to protect this part of cpp code.Verifying this change
cpp unit tests passed, especially for test
testPatternMultiTopicsConsumerPubSub