BewareMyPower commented on issue #7327:
URL: https://github.com/apache/pulsar/issues/7327#issuecomment-653651172
I cannot reproduce the problem, assuming your code is like:
```c++
#include <iostream>
#include <string>
#include <pulsar/c/client.h>
int main(int argc, char* argv[]) {
if (argc < 2) {
std::cerr << "Usage: " << argv[0] << " service-url" << std::endl;
return 1;
}
std::string topic = "Foo";
std::string service_url = argv[1];
auto m_conf = pulsar_client_configuration_create();
auto m_client = pulsar_client_create(service_url.c_str(), m_conf);
auto producer_conf = pulsar_producer_configuration_create();
pulsar_producer_configuration_set_batching_enabled(producer_conf, 0);
pulsar_producer_configuration_set_max_pending_messages(producer_conf,
10000);
pulsar_producer_t* producer = NULL;
auto err = pulsar_client_create_producer(m_client, topic.c_str(),
producer_conf, &producer);
if (err != pulsar_result_Ok) {
pulsar_producer_configuration_free(producer_conf);
return 1;
}
return 0;
}
```
The running result:
```
$ ./examples/SampleProducer pulsar://127.0.0.1:5678
2020-07-04 02:32:31.475 INFO [140369736358592] ConnectionPool:85 | Created
connection for pulsar://127.0.0.1:5678
2020-07-04 02:32:31.477 ERROR [140369636267776] ClientConnection:385 |
[<none> -> pulsar://127.0.0.1:5678] Failed to establish connection: Connection
refused
2020-07-04 02:32:31.477 INFO [140369636267776] ClientConnection:1372 |
[<none> -> pulsar://127.0.0.1:5678] Connection closed
2020-07-04 02:32:31.477 ERROR [140369636267776] ClientImpl:180 | Error
Checking/Getting Partition Metadata while creating producer on
persistent://public/default/Foo -- ConnectError
2020-07-04 02:32:31.477 INFO [140369636267776] ClientConnection:235 |
[<none> -> pulsar://127.0.0.1:5678] Destroyed connection
```
Could you provide your log? In addition, could you use a higher version GCC
to debug? Your backtrace lost some debug info because of libstdc++'s BUG, see
[How we discovered why C++ exceptions disappear in stack
trace](https://le.qun.ch/en/blog/libstdc++-bug/)
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]