Is there a way for the C++ Pulsar client to know whether it is connected to the server or not? #19635
Unanswered
pulsar-community-bot
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Pulsar User
Is there a way for the C++ Pulsar client to know whether it is connected to the server or not?
David K
Assuming the C++ client? When you use the client to create a consumer using one of the subscribe methods, you will get a Result object back indicating the status. A
ResultOkis success, the rest indicate some sort of connectivity issue, e.g.ResultConnectErrororResultNotConnectedFWIW, the same Result object is returned from any of the
createProducercalls as well.Pulsar User
ok I will do some operation result to show if client is connected.
David K
But, the C++ and Python clients don’t have am
isClosed()method like the java client does. Perhaps you can open a feature request for this?All reactions