17 #ifndef INCLUDED_BMQT_QUEUEOPTIONS
18 #define INCLUDED_BMQT_QUEUEOPTIONS
49 #include <bsl_iosfwd.h>
50 #include <bsl_optional.h>
51 #include <bsl_unordered_map.h>
52 #include <bsl_vector.h>
53 #include <bslma_allocator.h>
54 #include <bslma_usesbslmaallocator.h>
55 #include <bslmf_nestedtraitdeclaration.h>
83 typedef bsl::unordered_map<SubscriptionHandle, Subscription> Subscriptions;
90 bsl::optional<bool> d_suspendsOnBadHostHealth;
92 Subscriptions d_subscriptions;
96 bool d_hadSubscriptions;
99 bslma::Allocator* d_allocator_p;
113 BSLMF_NESTED_TRAIT_DECLARATION(
QueueOptions, bslma::UsesBslmaAllocator)
231 print(bsl::ostream& stream,
int level = 0,
int spacesPerLevel = 4) const;
248 bsl::ostream& operator<<(bsl::ostream& stream, const
QueueOptions& rhs);
264 d_suspendsOnBadHostHealth = rhs.d_suspendsOnBadHostHealth;
265 d_hadSubscriptions = rhs.d_hadSubscriptions;
266 d_subscriptions = Subscriptions(rhs.d_subscriptions,
267 this->d_allocator_p);
293 d_suspendsOnBadHostHealth.emplace(value);
315 return d_suspendsOnBadHostHealth.value_or(
336 return d_suspendsOnBadHostHealth.has_value();
366 return rhs.
print(stream, 0, -1);
Provide a value-semantic types for subscription related API.
Value-semantic type for options related to a queue.
Definition: bmqt_queueoptions.h:66
static const bool k_DEFAULT_SUSPENDS_ON_BAD_HOST_HEALTH
Definition: bmqt_queueoptions.h:79
QueueOptions & setMaxUnconfirmedBytes(int value)
Definition: bmqt_queueoptions.h:279
int maxUnconfirmedMessages() const
Get the number for the maxUnconfirmedMessages parameter.
Definition: bmqt_queueoptions.h:298
bool hasConsumerPriority() const
Definition: bmqt_queueoptions.h:329
QueueOptions & merge(const QueueOptions &other)
int maxUnconfirmedBytes() const
Get the number for the maxUnconfirmedBytes parameter.
Definition: bmqt_queueoptions.h:303
QueueOptions & setConsumerPriority(int value)
Definition: bmqt_queueoptions.h:285
bool suspendsOnBadHostHealth() const
Get whether the queue suspends operation while host is unhealthy.
Definition: bmqt_queueoptions.h:313
QueueOptions & setSuspendsOnBadHostHealth(bool value)
Set whether the queue suspends operation while host is unhealthy.
Definition: bmqt_queueoptions.h:291
bool loadSubscription(Subscription *subscription, const SubscriptionHandle &handle) const
bool hasMaxUnconfirmedMessages() const
Definition: bmqt_queueoptions.h:319
QueueOptions & setMaxUnconfirmedMessages(int value)
Definition: bmqt_queueoptions.h:273
bsl::pair< SubscriptionHandle, Subscription > HandleAndSubscription
Definition: bmqt_queueoptions.h:104
static const int k_CONSUMER_PRIORITY_MIN
Constant representing the minimum valid consumer priority.
Definition: bmqt_queueoptions.h:71
static const int k_CONSUMER_PRIORITY_MAX
Constant representing the maximum valid consumer priority.
Definition: bmqt_queueoptions.h:74
static const int k_DEFAULT_MAX_UNCONFIRMED_MESSAGES
Definition: bmqt_queueoptions.h:76
void loadSubscriptions(SubscriptionsSnapshot *snapshot) const
bool removeSubscription(const SubscriptionHandle &handle)
int consumerPriority() const
Get the number for the consumerPriority parameter.
Definition: bmqt_queueoptions.h:308
bool addOrUpdateSubscription(bsl::string *errorDescription, const SubscriptionHandle &handle, const Subscription &subscription)
void removeAllSubscriptions()
bool hasMaxUnconfirmedBytes() const
Definition: bmqt_queueoptions.h:324
bool hasSuspendsOnBadHostHealth() const
Definition: bmqt_queueoptions.h:334
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
bsl::vector< HandleAndSubscription > SubscriptionsSnapshot
Definition: bmqt_queueoptions.h:109
static const int k_DEFAULT_CONSUMER_PRIORITY
Definition: bmqt_queueoptions.h:78
static const int k_DEFAULT_MAX_UNCONFIRMED_BYTES
Definition: bmqt_queueoptions.h:77
Value-semantic type for unique Subscription id.
Definition: bmqt_subscription.h:59
Value-semantic type to carry Subscription parameters.
Definition: bmqt_subscription.h:169
bool hasMaxUnconfirmedBytes() const
Definition: bmqt_subscription.h:469
bool hasMaxUnconfirmedMessages() const
Definition: bmqt_subscription.h:464
Subscription & setConsumerPriority(int value)
Definition: bmqt_subscription.h:429
int consumerPriority() const
Get the number for the consumerPriority parameter.
Definition: bmqt_subscription.h:454
Subscription & setMaxUnconfirmedBytes(int value)
Definition: bmqt_subscription.h:423
Subscription & setMaxUnconfirmedMessages(int value)
Definition: bmqt_subscription.h:417
int maxUnconfirmedMessages() const
Get the number for the maxUnconfirmedMessages parameter.
Definition: bmqt_subscription.h:443
int maxUnconfirmedBytes() const
Get the number for the maxUnconfirmedBytes parameter.
Definition: bmqt_subscription.h:449
bool hasConsumerPriority() const
Definition: bmqt_subscription.h:474
bsl::ostream & operator<<(bsl::ostream &stream, CompressionAlgorithmType::Enum value)
Definition: bmqt_compressionalgorithmtype.h:141
bool operator!=(const CorrelationId &lhs, const CorrelationId &rhs)
Definition: bmqt_correlationid.h:582
bool operator==(const CorrelationId &lhs, const CorrelationId &rhs)
Definition: bmqt_correlationid.h:576
Definition: bmqa_abstractsession.h:42