Hazelcast C++ Client
Hazelcast C++ Client Library
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. More...
 
int get_read_batch_size () const
 Gets the maximum number of items to read in a batch. More...
 
reliable_topic_configset_read_batch_size (int batch_size)
 Sets the read batch size. More...
 

Static Public Attributes

static constexpr int DEFAULT_READ_BATCH_SIZE = 10
 

Detailed Description

Definition at line 29 of file reliable_topic_config.h.

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 362 of file config.cpp.

362  {
363  return name_;
364  }

◆ 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 366 of file config.cpp.

366  {
367  return read_batch_size_;
368  }

◆ 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 370 of file config.cpp.

370  {
371  if (batch_size <= 0) {
372  BOOST_THROW_EXCEPTION(exception::illegal_argument("ReliableTopicConfig::setReadBatchSize",
373  "readBatchSize should be positive"));
374  }
375 
376  this->read_batch_size_ = batch_size;
377 
378  return *this;
379  }

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