Skip to content

Commit

Permalink
fix#2425 rdkafka_example_cpp -L to list metadata can't assign topic
Browse files Browse the repository at this point in the history
./rdkafka_example_cpp -L -b 172.17.0.2:9092 -t test_topic
./rdkafka_example_cpp -L -b 172.17.0.2:9092
execute above two commands, the result is the same. The reason is topic!=NULL should be !topic in 661 line
  • Loading branch information
njzcx authored and edenhill committed Jul 25, 2019
1 parent 0b98c7b commit b4a3da1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/rdkafka_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ int main (int argc, char **argv) {
class RdKafka::Metadata *metadata;

/* Fetch metadata */
RdKafka::ErrorCode err = producer->metadata(topic!=NULL, topic,
RdKafka::ErrorCode err = producer->metadata(!topic, topic,
&metadata, 5000);
if (err != RdKafka::ERR_NO_ERROR) {
std::cerr << "%% Failed to acquire metadata: "
Expand Down

0 comments on commit b4a3da1

Please sign in to comment.