|
pulsar-client-cpp
|
#include <ReaderConfiguration.h>
Public Member Functions | |
| ReaderConfiguration (const ReaderConfiguration &) | |
| ReaderConfiguration & | operator= (const ReaderConfiguration &) |
| ReaderConfiguration & | setSchema (const SchemaInfo &schemaInfo) |
| const SchemaInfo & | getSchema () const |
| ReaderConfiguration & | setReaderListener (ReaderListener listener) |
| ReaderListener | getReaderListener () const |
| bool | hasReaderListener () const |
| void | setReceiverQueueSize (int size) |
| int | getReceiverQueueSize () const |
| void | setReaderName (const std::string &readerName) |
| const std::string & | getReaderName () const |
| void | setSubscriptionRolePrefix (const std::string &subscriptionRolePrefix) |
| const std::string & | getSubscriptionRolePrefix () const |
| void | setReadCompacted (bool compacted) |
| bool | isReadCompacted () const |
Class specifying the configuration of a consumer.
| const SchemaInfo& pulsar::ReaderConfiguration::getSchema | ( | ) | const |
| ReaderConfiguration& pulsar::ReaderConfiguration::setReaderListener | ( | ReaderListener | listener | ) |
A message listener enables your application to configure how to process messages. A listener will be called in order for every message received.
| void pulsar::ReaderConfiguration::setReceiverQueueSize | ( | int | size | ) |
Sets the size of the reader receive queue.
The consumer receive queue controls how many messages can be accumulated by the Consumer before the application calls receive(). Using a higher value could potentially increase the consumer throughput at the expense of bigger memory utilization.
Setting the consumer queue size as zero decreases the throughput of the consumer, by disabling pre-fetching of messages. This approach improves the message distribution on shared subscription, by pushing messages only to the consumers that are ready to process them. Neither receive with timeout nor Partitioned Topics can be used if the consumer queue size is zero. The receive() function call should not be interrupted when the consumer queue size is zero.
Default value is 1000 messages and should be good for most use cases.
| size | the new receiver queue size value |
| ReaderConfiguration& pulsar::ReaderConfiguration::setSchema | ( | const SchemaInfo & | schemaInfo | ) |
Declare the schema of the data that this reader will be accepting.
The schema will be checked against the schema of the topic, and the reader creation will fail if it's not compatible.
| schemaInfo | the schema definition object |
1.8.16