Quick Links:

bmqa | bmqpi | bmqt

Public Types | Public Member Functions | Static Public Attributes

bmqt::QueueOptions Class Reference

#include <bmqt_queueoptions.h>

List of all members.

Public Types

typedef bsl::pair
< SubscriptionHandle,
Subscription
HandleAndSubscription
typedef bsl::vector
< HandleAndSubscription
SubscriptionsSnapshot

Public Member Functions

 QueueOptions (bslma::Allocator *allocator=0)
 QueueOptions (const QueueOptions &other, bslma::Allocator *allocator=0)
QueueOptionssetMaxUnconfirmedMessages (int value)
QueueOptionssetMaxUnconfirmedBytes (int value)
QueueOptionssetConsumerPriority (int value)
QueueOptionssetSuspendsOnBadHostHealth (bool value)
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
int maxUnconfirmedBytes () const
int consumerPriority () const
bool suspendsOnBadHostHealth () const
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
static const int k_CONSUMER_PRIORITY_MAX
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

Detailed Description

Value-semantic type for options related to a queue.

See Component bmqt_queueoptions


Member Typedef Documentation


Constructor & Destructor Documentation

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

Create a new QueueOptions using the optionally specified allocator.

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

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

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.

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

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

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

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

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

Set whether the queue suspends operation while host is unhealthy.

QueueOptions& 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.

bool 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.

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

Return false if subscription does not exist.

EXPERIMENTAL. Do not use until this feature is announced.

void bmqt::QueueOptions::removeAllSubscriptions (  ) 

Remove all subscriptions.

EXPERIMENTAL. Do not use until this feature is announced.

int bmqt::QueueOptions::maxUnconfirmedMessages (  )  const

Get the number for the maxUnconfirmedMessages parameter.

int bmqt::QueueOptions::maxUnconfirmedBytes (  )  const

Get the number for the maxUnconfirmedBytes parameter.

int bmqt::QueueOptions::consumerPriority (  )  const

Get the number for the consumerPriority parameter.

bool bmqt::QueueOptions::suspendsOnBadHostHealth (  )  const

Get whether the queue suspends operation while host is unhealthy.

bool bmqt::QueueOptions::hasMaxUnconfirmedMessages (  )  const

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

bool bmqt::QueueOptions::hasMaxUnconfirmedBytes (  )  const

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

bool bmqt::QueueOptions::hasConsumerPriority (  )  const

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

bool bmqt::QueueOptions::hasSuspendsOnBadHostHealth (  )  const

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

bool 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.

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

Load all handles and subscriptions into the specified snapshot.

EXPERIMENTAL. Do not use until this feature is announced.

bsl::ostream& 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.


Member Data Documentation


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