Skip to content

Commit eeeb643

Browse files
authored
[ISSUE #928] [CPP] Fix some cpp client bug and make logs cleaner (#929)
1 parent a60bec6 commit eeeb643

22 files changed

+62
-63
lines changed

.github/workflows/cpp_build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
# Disable VS 2022 before https://github.com/bazelbuild/bazel/issues/18592 issue is solved
1212
# Remove macos-11 since there is no such runner available
1313
# os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, windows-2019, windows-2022]
14-
os: [ubuntu-20.04, ubuntu-22.04, macos-12, windows-2019]
14+
os: [ubuntu-20.04, ubuntu-22.04, windows-2019]
1515
steps:
1616
- uses: actions/checkout@v2
1717
- name: Compile On Linux

cpp/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ bazel-rocketmq-client-cpp
1919
/compile_commands.json
2020
/.cache/
2121
.clangd
22+
build

cpp/examples/ExampleFifoProducer.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "rocketmq/FifoProducer.h"
2929
#include "rocketmq/Logger.h"
3030
#include "rocketmq/Message.h"
31-
#include "rocketmq/Producer.h"
3231
#include "rocketmq/SendReceipt.h"
3332

3433
using namespace ROCKETMQ_NAMESPACE;
@@ -93,8 +92,8 @@ std::string randomString(std::string::size_type len) {
9392
return result;
9493
}
9594

96-
DEFINE_string(topic, "standard_topic_sample", "Topic to which messages are published");
97-
DEFINE_string(access_point, "121.196.167.124:8081", "Service access URL, provided by your service provider");
95+
DEFINE_string(topic, "FifoTopic", "Topic to which messages are published");
96+
DEFINE_string(access_point, "127.0.0.1:8081", "Service access URL, provided by your service provider");
9897
DEFINE_int32(message_body_size, 4096, "Message body size");
9998
DEFINE_uint32(total, 256, "Number of sample messages to publish");
10099
DEFINE_string(access_key, "", "Your access key ID");

cpp/examples/ExampleProducer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ std::string randomString(std::string::size_type len) {
5151
return result;
5252
}
5353

54-
DEFINE_string(topic, "standard_topic_sample", "Topic to which messages are published");
55-
DEFINE_string(access_point, "121.196.167.124:8081", "Service access URL, provided by your service provider");
54+
DEFINE_string(topic, "NormalTopic", "Topic to which messages are published");
55+
DEFINE_string(access_point, "127.0.0.1:8081", "Service access URL, provided by your service provider");
5656
DEFINE_int32(message_body_size, 4096, "Message body size");
5757
DEFINE_uint32(total, 256, "Number of sample messages to publish");
5858
DEFINE_string(access_key, "", "Your access key ID");

cpp/examples/ExampleProducerWithAsync.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ std::string randomString(std::string::size_type len) {
8989
return result;
9090
}
9191

92-
DEFINE_string(topic, "standard_topic_sample", "Topic to which messages are published");
93-
DEFINE_string(access_point, "121.196.167.124:8081", "Service access URL, provided by your service provider");
92+
DEFINE_string(topic, "NormalTopic", "Topic to which messages are published");
93+
DEFINE_string(access_point, "127.0.0.1:8081", "Service access URL, provided by your service provider");
9494
DEFINE_int32(message_body_size, 4096, "Message body size");
9595
DEFINE_uint32(total, 256, "Number of sample messages to publish");
9696
DEFINE_uint32(concurrency, 128, "Concurrency of async send");

cpp/examples/ExampleProducerWithFifoMessage.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ std::string randomString(std::string::size_type len) {
4848
return result;
4949
}
5050

51-
DEFINE_string(topic, "fifo_topic_sample", "Topic to which messages are published");
52-
DEFINE_string(access_point, "121.196.167.124:8081", "Service access URL, provided by your service provider");
51+
DEFINE_string(topic, "FifoTopic", "Topic to which messages are published");
52+
DEFINE_string(access_point, "127.0.0.1:8081", "Service access URL, provided by your service provider");
5353
DEFINE_int32(message_body_size, 4096, "Message body size");
5454
DEFINE_uint32(total, 256, "Number of sample messages to publish");
5555
DEFINE_string(access_key, "", "Your access key ID");

cpp/examples/ExampleProducerWithTimedMessage.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include <algorithm>
1818
#include <atomic>
1919
#include <chrono>
20-
#include <cstddef>
2120
#include <iostream>
2221
#include <random>
2322
#include <string>
@@ -50,8 +49,8 @@ std::string randomString(std::string::size_type len) {
5049
return result;
5150
}
5251

53-
DEFINE_string(topic, "standard_topic_sample", "Topic to which messages are published");
54-
DEFINE_string(access_point, "121.196.167.124:8081", "Service access URL, provided by your service provider");
52+
DEFINE_string(topic, "TimerTopic", "Topic to which messages are published");
53+
DEFINE_string(access_point, "127.0.0.1:8081", "Service access URL, provided by your service provider");
5554
DEFINE_int32(message_body_size, 4096, "Message body size");
5655
DEFINE_uint32(total, 256, "Number of sample messages to publish");
5756
DEFINE_string(access_key, "", "Your access key ID");

cpp/examples/ExampleProducerWithTransactionalMessage.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ std::string randomString(std::string::size_type len) {
4848
return result;
4949
}
5050

51-
DEFINE_string(topic, "tx_topic_sample", "Topic to which messages are published");
52-
DEFINE_string(access_point, "121.196.167.124:8081", "Service access URL, provided by your service provider");
51+
DEFINE_string(topic, "TransTopic", "Topic to which messages are published");
52+
DEFINE_string(access_point, "127.0.0.1:8081", "Service access URL, provided by your service provider");
5353
DEFINE_int32(message_body_size, 4096, "Message body size");
5454
DEFINE_uint32(total, 256, "Number of sample messages to publish");
5555
DEFINE_string(access_key, "", "Your access key ID");

cpp/examples/ExamplePushConsumer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424

2525
using namespace ROCKETMQ_NAMESPACE;
2626

27-
DEFINE_string(topic, "standard_topic_sample", "Topic to which messages are published");
28-
DEFINE_string(access_point, "121.196.167.124:8081", "Service access URL, provided by your service provider");
29-
DEFINE_string(group, "CID_standard_topic_sample", "GroupId, created through your instance management console");
27+
DEFINE_string(topic, "NormalTopic", "Topic to which messages are published");
28+
DEFINE_string(access_point, "127.0.0.1:8081", "Service access URL, provided by your service provider");
29+
DEFINE_string(group, "PushConsumer", "GroupId, created through your instance management console");
3030
DEFINE_string(access_key, "", "Your access key ID");
3131
DEFINE_string(access_secret, "", "Your access secret");
3232
DEFINE_bool(tls, false, "Use HTTP2 with TLS/SSL");

cpp/examples/ExampleSimpleConsumer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323

2424
using namespace ROCKETMQ_NAMESPACE;
2525

26-
DEFINE_string(topic, "standard_topic_sample", "Topic to which messages are published");
27-
DEFINE_string(access_point, "121.196.167.124:8081", "Service access URL, provided by your service provider");
28-
DEFINE_string(group, "CID_standard_topic_sample", "GroupId, created through your instance management console");
26+
DEFINE_string(topic, "NormalTopic", "Topic to which messages are published");
27+
DEFINE_string(access_point, "127.0.0.1:8081", "Service access URL, provided by your service provider");
28+
DEFINE_string(group, "SimpleConsumer", "GroupId, created through your instance management console");
2929
DEFINE_string(access_key, "", "Your access key ID");
3030
DEFINE_string(access_secret, "", "Your access secret");
3131
DEFINE_bool(tls, false, "Use HTTP2 with TLS/SSL");

0 commit comments

Comments
 (0)