libbmq  a5f8a06ba1d16cb5a65643e1fa7f1a1d6aadef40
BloombergLP::bmqt::QueueOptions Class Reference

Value-semantic type for options related to a queue.

#include <bmqt_queueoptions.h>

Public Types

typedef bsl::pair< SubscriptionHandle, SubscriptionHandleAndSubscription
 
typedef bsl::vector< HandleAndSubscriptionSubscriptionsSnapshot
 

Public Member Functions

 QueueOptions (bslma::Allocator *allocator=0)
 
 QueueOptions (const QueueOptions &other, bslma::Allocator *allocator=0)
 
QueueOptionsoperator= (const QueueOptions &rhs)
 Assign to this object the value of the specified rhs object. More...
 
QueueOptionssetMaxUnconfirmedMessages (int value)
 
QueueOptionssetMaxUnconfirmedBytes (int value)
 
QueueOptionssetConsumerPriority (int value)
 
QueueOptionssetSuspendsOnBadHostHealth (bool value)
 Set whether the queue suspends operation while host is unhealthy. More...
 
QueueOptionsmerge (const QueueOptions &other)
 
bool addOrUpdateSubscription (bsl::string *errorDescription, const SubscriptionHandle &handle, const Subscription &subscription)
 
bool removeSubscription (const SubscriptionHandle &handle)
 
void removeAllSubscriptions ()
 
int maxUnconfirmedMessages () const
 Get the number for the maxUnconfirmedMessages parameter. More...
 
int maxUnconfirmedBytes () const
 Get the number for the maxUnconfirmedBytes parameter. More...
 
int consumerPriority () const
 Get the number for the consumerPriority parameter. More...
 
bool suspendsOnBadHostHealth () const
 Get whether the queue suspends operation while host is unhealthy. More...
 
bool hasMaxUnconfirmedMessages () const
 
bool hasMaxUnconfirmedBytes () const
 
bool hasConsumerPriority () const
 
bool hasSuspendsOnBadHostHealth () const
 
bool loadSubscription (Subscription *subscription, const SubscriptionHandle &handle) const
 
void loadSubscriptions (SubscriptionsSnapshot *snapshot) const
 
bsl::ostream & print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
 

Static Public Attributes

static const int k_CONSUMER_PRIORITY_MIN
 Constant representing the minimum valid consumer priority. More...
 
static const int k_CONSUMER_PRIORITY_MAX
 Constant representing the maximum valid consumer priority. More...
 
static const int k_DEFAULT_MAX_UNCONFIRMED_MESSAGES
 
static const int k_DEFAULT_MAX_UNCONFIRMED_BYTES
 
static const int k_DEFAULT_CONSUMER_PRIORITY
 
static const bool k_DEFAULT_SUSPENDS_ON_BAD_HOST_HEALTH
 

Member Typedef Documentation

◆ HandleAndSubscription

◆ SubscriptionsSnapshot

loadSubscriptions return types

EXPERIMENTAL. Do not use until this feature is announced.

Constructor & Destructor Documentation

◆ QueueOptions() [1/2]

BloombergLP::bmqt::QueueOptions::QueueOptions ( bslma::Allocator *  allocator = 0)
explicit

Create a new QueueOptions using the optionally specified allocator.

◆ QueueOptions() [2/2]

BloombergLP::bmqt::QueueOptions::QueueOptions ( const QueueOptions other,
bslma::Allocator *  allocator = 0 
)

Create a new QueueOptions by copying values from the specified other, using the optionally specified allocator.

Member Function Documentation

◆ operator=()

QueueOptions & BloombergLP::bmqt::QueueOptions::operator= ( const QueueOptions rhs)
inline

◆ setMaxUnconfirmedMessages()

QueueOptions & BloombergLP::bmqt::QueueOptions::setMaxUnconfirmedMessages ( int  value)
inline

Set the maxUnconfirmedMessages to the specified value. The behavior is undefined unless value >= 0. If the specified value is set to 0, it means that the consumer does not receive any messages. This might be useful when the consumer is shutting down and wants to process only pending messages, or when it is unable to process new messages because of transient issues.

References BloombergLP::bmqt::Subscription::setMaxUnconfirmedMessages().

◆ setMaxUnconfirmedBytes()

QueueOptions & BloombergLP::bmqt::QueueOptions::setMaxUnconfirmedBytes ( int  value)
inline

Set the maxUnconfirmedBytes to the specified value. The behavior is undefined unless value >= 0.

References BloombergLP::bmqt::Subscription::setMaxUnconfirmedBytes().

◆ setConsumerPriority()

QueueOptions & BloombergLP::bmqt::QueueOptions::setConsumerPriority ( int  value)
inline

Set the consumerPriority to the specified value. The behavior is undefined unless 'k_CONSUMER_PRIORITY_MIN <= value <= k_CONSUMER_PRIORITY_MAX'

References BloombergLP::bmqt::Subscription::setConsumerPriority().

◆ setSuspendsOnBadHostHealth()

QueueOptions & BloombergLP::bmqt::QueueOptions::setSuspendsOnBadHostHealth ( bool  value)
inline

◆ merge()

QueueOptions& BloombergLP::bmqt::QueueOptions::merge ( const QueueOptions other)

"Merges" another QueueOptions into this one, by invoking setF(other.F()) for all fields F for which other.hasF() is true. Returns the instance on which the method was invoked.

◆ addOrUpdateSubscription()

bool BloombergLP::bmqt::QueueOptions::addOrUpdateSubscription ( bsl::string *  errorDescription,
const SubscriptionHandle handle,
const Subscription subscription 
)

Add, or update if it exists, the specified subscription for the specified handle. Return true on success, otherwise return false and load the specified errorDescription with a description of the error. Note that errorDescription may be null if the caller does not care about getting error messages, but users are strongly encouraged to log error string if this API returns failure.

EXPERIMENTAL. Do not use until this feature is announced.

◆ removeSubscription()

bool BloombergLP::bmqt::QueueOptions::removeSubscription ( const SubscriptionHandle handle)

Return false if subscription does not exist.

EXPERIMENTAL. Do not use until this feature is announced.

◆ removeAllSubscriptions()

void BloombergLP::bmqt::QueueOptions::removeAllSubscriptions ( )

Remove all subscriptions.

EXPERIMENTAL. Do not use until this feature is announced.

◆ maxUnconfirmedMessages()

int BloombergLP::bmqt::QueueOptions::maxUnconfirmedMessages ( ) const
inline

◆ maxUnconfirmedBytes()

int BloombergLP::bmqt::QueueOptions::maxUnconfirmedBytes ( ) const
inline

◆ consumerPriority()

int BloombergLP::bmqt::QueueOptions::consumerPriority ( ) const
inline

◆ suspendsOnBadHostHealth()

bool BloombergLP::bmqt::QueueOptions::suspendsOnBadHostHealth ( ) const
inline

◆ hasMaxUnconfirmedMessages()

bool BloombergLP::bmqt::QueueOptions::hasMaxUnconfirmedMessages ( ) const
inline

Returns whether maxUnconfirmedMessages has been set for this object, or whether it implicitly holds k_DEFAULT_MAX_UNCONFIRMED_MESSAGES.

References BloombergLP::bmqt::Subscription::hasMaxUnconfirmedMessages().

◆ hasMaxUnconfirmedBytes()

bool BloombergLP::bmqt::QueueOptions::hasMaxUnconfirmedBytes ( ) const
inline

Returns whether maxUnconfirmedBytes has been set for this object, or whether it implicitly holds k_DEFAULT_MAX_UNCONFIRMED_BYTES.

References BloombergLP::bmqt::Subscription::hasMaxUnconfirmedBytes().

◆ hasConsumerPriority()

bool BloombergLP::bmqt::QueueOptions::hasConsumerPriority ( ) const
inline

Returns whether consumerPriority has been set for this object, or whether it implicitly holds k_DEFAULT_CONSUMER_PRIORITY.

References BloombergLP::bmqt::Subscription::hasConsumerPriority().

◆ hasSuspendsOnBadHostHealth()

bool BloombergLP::bmqt::QueueOptions::hasSuspendsOnBadHostHealth ( ) const
inline

Returns whether suspendsOnBadHostHealth has been set for this object, or whether it implicitly holds k_DEFAULT_SUSPENDS_ON_BAD_HOST_HEALTH.

◆ loadSubscription()

bool BloombergLP::bmqt::QueueOptions::loadSubscription ( Subscription subscription,
const SubscriptionHandle handle 
) const

Return false if subscription does not exist.

EXPERIMENTAL. Do not use until this feature is announced.

◆ loadSubscriptions()

void BloombergLP::bmqt::QueueOptions::loadSubscriptions ( SubscriptionsSnapshot snapshot) const

Load all handles and subscriptions into the specified snapshot.

EXPERIMENTAL. Do not use until this feature is announced.

◆ print()

bsl::ostream& BloombergLP::bmqt::QueueOptions::print ( bsl::ostream &  stream,
int  level = 0,
int  spacesPerLevel = 4 
) const

Format this object to the specified output stream at the (absolute value of) the optionally specified indentation level and return a reference to stream. If level is specified, optionally specify spacesPerLevel, the number of spaces per indentation level for this and all of its nested objects. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative format the entire output on one line, suppressing all but the initial indentation (as governed by level). If stream is not valid on entry, this operation has no effect.

Referenced by BloombergLP::bmqt::operator<<().

Member Data Documentation

◆ k_CONSUMER_PRIORITY_MIN

const int BloombergLP::bmqt::QueueOptions::k_CONSUMER_PRIORITY_MIN
static

◆ k_CONSUMER_PRIORITY_MAX

const int BloombergLP::bmqt::QueueOptions::k_CONSUMER_PRIORITY_MAX
static

◆ k_DEFAULT_MAX_UNCONFIRMED_MESSAGES

const int BloombergLP::bmqt::QueueOptions::k_DEFAULT_MAX_UNCONFIRMED_MESSAGES
static

◆ k_DEFAULT_MAX_UNCONFIRMED_BYTES

const int BloombergLP::bmqt::QueueOptions::k_DEFAULT_MAX_UNCONFIRMED_BYTES
static

◆ k_DEFAULT_CONSUMER_PRIORITY

const int BloombergLP::bmqt::QueueOptions::k_DEFAULT_CONSUMER_PRIORITY
static

◆ k_DEFAULT_SUSPENDS_ON_BAD_HOST_HEALTH

const bool BloombergLP::bmqt::QueueOptions::k_DEFAULT_SUSPENDS_ON_BAD_HOST_HEALTH
static

Referenced by suspendsOnBadHostHealth().


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