Hazelcast C++ Client
Hazelcast C++ Client Library
Loading...
Searching...
No Matches
hazelcast::client::config::reliable_topic_config Class Reference

Public Member Functions

 reliable_topic_config (std::string topic_name)
const std::string & get_name () const
 Gets the name of the reliable topic.
int get_read_batch_size () const
 Gets the maximum number of items to read in a batch.
reliable_topic_configset_read_batch_size (int batch_size)
 Sets the read batch size.

Static Public Attributes

static constexpr int DEFAULT_READ_BATCH_SIZE = 10

Detailed Description

Definition at line 29 of file reliable_topic_config.h.

Constructor & Destructor Documentation

◆ reliable_topic_config()

hazelcast::client::config::reliable_topic_config::reliable_topic_config ( std::string topic_name)
explicit

Definition at line 481 of file config.cpp.

482 : read_batch_size_(DEFAULT_READ_BATCH_SIZE)
483 ,
484
485 name_(std::move(topic_name))
486{}

Member Function Documentation

◆ get_name()

const std::string & hazelcast::client::config::reliable_topic_config::get_name ( ) const

Gets the name of the reliable topic.

Returns
the name of the reliable topic.

Definition at line 489 of file config.cpp.

490{
491 return name_;
492}

◆ get_read_batch_size()

int hazelcast::client::config::reliable_topic_config::get_read_batch_size ( ) const

Gets the maximum number of items to read in a batch.

Returned value will always be equal or larger than 1.

Returns
the read batch size.

Definition at line 495 of file config.cpp.

496{
497 return read_batch_size_;
498}

◆ set_read_batch_size()

reliable_topic_config & hazelcast::client::config::reliable_topic_config::set_read_batch_size ( int batch_size)

Sets the read batch size.

The ReliableTopic tries to read a batch of messages from the ringbuffer. It will get at least one, but if there are more available, then it will try to get more to increase throughput. The minimal read batch size can be influenced using the read batch size.

If the readBatchSize is 10 and there are 50 messages available, 10 items are retrieved and processed consecutively.

If the readBatchSize is 10 and there are 2 items available, 2 items are retrieved and processed consecutively.

Parameters
readBatchSizethe maximum number of items to read in a batch.
Returns
the updated reliable topic config.
Exceptions
illegal_argumentif readBatchSize is smaller than 1.

Definition at line 501 of file config.cpp.

502{
503 if (batch_size <= 0) {
504 BOOST_THROW_EXCEPTION(
505 exception::illegal_argument("ReliableTopicConfig::setReadBatchSize",
506 "readBatchSize should be positive"));
507 }
508
509 this->read_batch_size_ = batch_size;
510
511 return *this;
512}

Member Data Documentation

◆ DEFAULT_READ_BATCH_SIZE

int hazelcast::client::config::reliable_topic_config::DEFAULT_READ_BATCH_SIZE = 10
staticconstexpr

Definition at line 32 of file reliable_topic_config.h.


The documentation for this class was generated from the following files: