BewareMyPower commented on issue #576:
URL:
https://github.com/apache/pulsar-client-cpp/issues/576#issuecomment-4589363743
Good finding! It can be easily reproduced via applying the patch below and
running `example/SampleProducer`:
```diff
diff --git a/examples/SampleProducer.cc b/examples/SampleProducer.cc
index 0a3c693..d3cd3a7 100644
--- a/examples/SampleProducer.cc
+++ b/examples/SampleProducer.cc
@@ -18,7 +18,9 @@
*/
#include <pulsar/Client.h>
+#include <chrono>
#include <iostream>
+#include <thread>
#include "lib/LogUtils.h"
@@ -29,17 +31,16 @@ using namespace pulsar;
int main() {
Client client("pulsar://localhost:6650");
+ ProducerConfiguration conf;
+ conf.setSendTimeout(100);
Producer producer;
- Result result =
client.createProducer("persistent://public/default/my-topic", producer);
+ Result result =
client.createProducer("persistent://public/default/my-topic", conf, producer);
if (result != ResultOk) {
LOG_ERROR("Error creating producer: " << result);
return -1;
}
- // Send synchronously
- Message msg = MessageBuilder().setContent("content").build();
- Result res = producer.send(msg);
- LOG_INFO("Message sent: " << res);
+ std::this_thread::sleep_for(std::chrono::seconds(3));;
client.close();
}
```
Outputs:
```
2026-06-01 11:45:30.949 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:31.050 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:31.151 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:31.252 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:31.353 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:31.455 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:31.555 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:31.656 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:31.757 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:31.858 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:31.959 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:32.060 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:32.161 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:32.262 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:32.363 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:32.465 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:32.565 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:32.666 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:32.767 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:32.869 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:32.969 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:33.071 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:33.171 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:33.273 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:33.373 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:33.474 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:33.576 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:33.677 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
2026-06-01 11:45:33.778 WARN [0x16b743000] ProducerImpl:880 |
[persistent://public/default/my-topic, standalone-0-0] Send timeout due to
queueing delay, connection: [127.0.0.1:50662 -> 127.0.0.1:6650] , pending
messages: 0, queue size: 0
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]