#include <Reader.h>
|
class | PulsarFriend |
|
class | PulsarWrapper |
|
class | ReaderImpl |
|
class | TableViewImpl |
|
class | ReaderTest |
|
A Reader can be used to scan through all the messages currently available in a topic.
◆ Reader()
pulsar::Reader::Reader |
( |
| ) |
|
Construct an uninitialized reader object
◆ close()
Result pulsar::Reader::close |
( |
| ) |
|
Close the reader and stop the broker to push more messages
- Returns
- ResultOk if the reader is closed successfully
◆ closeAsync()
Asynchronously close the reader and stop the broker to push more messages
- Parameters
-
callback | the callback that is triggered when the reader is closed |
◆ getLastMessageId()
Get an ID of the last available message or a message ID with -1 as an entryId if the topic is empty.
◆ getLastMessageIdAsync()
void pulsar::Reader::getLastMessageIdAsync |
( |
GetLastMessageIdCallback |
callback | ) |
|
Asynchronously get an ID of the last available message or a message ID with -1 as an entryId if the topic is empty.
◆ getTopic()
const std::string & pulsar::Reader::getTopic |
( |
| ) |
const |
- Returns
- the topic this reader is reading from
◆ hasMessageAvailable()
Result pulsar::Reader::hasMessageAvailable |
( |
bool & |
hasMessageAvailable | ) |
|
Check if there is any message available to read from the current position.
◆ hasMessageAvailableAsync()
void pulsar::Reader::hasMessageAvailableAsync |
( |
HasMessageAvailableCallback |
callback | ) |
|
Asynchronously check if there is any message available to read from the current position.
◆ isConnected()
bool pulsar::Reader::isConnected |
( |
| ) |
const |
- Returns
- Whether the reader is currently connected to the broker
◆ readNext() [1/2]
Read a single message.
If a message is not immediately available, this method will block until a new message is available.
- Parameters
-
msg | a non-const reference where the received message will be copied |
- Returns
- ResultOk when a message is received
-
ResultInvalidConfiguration if a message listener had been set in the configuration
◆ readNext() [2/2]
Read a single message
- Parameters
-
msg | a non-const reference where the received message will be copied |
timeoutMs | the receive timeout in milliseconds |
- Returns
- ResultOk if a message was received
-
ResultTimeout if the receive timeout was triggered
-
ResultInvalidConfiguration if a message listener had been set in the configuration
◆ readNextAsync()
void pulsar::Reader::readNextAsync |
( |
ReadNextCallback |
callback | ) |
|
Read asynchronously the next message in the topic.
- Parameters
-
◆ seek() [1/2]
Reset the this reader to a specific message id. The message id can either be a specific message or represent the first or last messages in the topic.
Note: this operation can only be done on non-partitioned topics. For these, one can rather perform the seek() on the individual partitions.
- Parameters
-
messageId | the message id where to reposition the subscription |
◆ seek() [2/2]
Result pulsar::Reader::seek |
( |
uint64_t |
timestamp | ) |
|
Reset this reader to a specific message publish time.
- Parameters
-
timestamp | the message publish time where to reposition the subscription |
◆ seekAsync() [1/2]
Asynchronously reset this reader to a specific message id. The message id can either be a specific message or represent the first or last messages in the topic.
Note: this operation can only be done on non-partitioned topics. For these, one can rather perform the seek() on the individual partitions.
- Parameters
-
messageId | the message id where to reposition the subscription |
◆ seekAsync() [2/2]
void pulsar::Reader::seekAsync |
( |
uint64_t |
timestamp, |
|
|
ResultCallback |
callback |
|
) |
| |
Asynchronously reset this reader to a specific message publish time.
- Parameters
-
timestamp | the message publish time where to reposition the subscription |
The documentation for this class was generated from the following file: