pulsar-client-cpp
|
Public Member Functions | |
Producer () | |
const std::string & | getTopic () const |
Result | send (const Message &msg) |
void | sendAsync (const Message &msg, SendCallback callback) |
Result | close () |
void | closeAsync (CloseCallback callback) |
Friends | |
class | ClientImpl |
class | PulsarFriend |
class | PulsarWrapper |
pulsar::Producer::Producer | ( | ) |
Construct an uninitialized Producer.
Result pulsar::Producer::close | ( | ) |
Close the producer and release resources allocated.
No more writes will be accepted from this producer. Waits until all pending write requests are persisted. In case of errors, pending writes will not be retried.
void pulsar::Producer::closeAsync | ( | CloseCallback | callback | ) |
Close the producer and release resources allocated.
No more writes will be accepted from this producer. The provided callback will be triggered when all pending write requests are persisted. In case of errors, pending writes will not be retried.
const std::string& pulsar::Producer::getTopic | ( | ) | const |
Publish a message on the topic associated with this Producer.
This method will block until the message will be accepted and persisted by the broker. In case of errors, the client library will try to automatically recover and use a different broker.
If it wasn't possible to successfully publish the message within the sendTimeout, an error will be returned.
This method is equivalent to asyncSend() and wait until the callback is triggered.
msg | message to publish |
void pulsar::Producer::sendAsync | ( | const Message & | msg, |
SendCallback | callback | ||
) |
Asynchronously publish a message on the topic associated with this Producer.
This method will initiate the publish operation and return immediately. The provided callback will be triggered when the message has been be accepted and persisted by the broker. In case of errors, the client library will try to automatically recover and use a different broker.
If it wasn't possible to successfully publish the message within the sendTimeout, the callback will be triggered with a Result::WriteError code.
msg | message to publish |
callback | the callback to get notification of the completion |