17 #ifndef INCLUDED_BMQT_SESSIONOPTIONS
18 #define INCLUDED_BMQT_SESSIONOPTIONS
128 #include <bdlt_timeunitratio.h>
129 #include <bsl_iosfwd.h>
130 #include <bsl_memory.h>
131 #include <bsl_string.h>
132 #include <bslma_allocator.h>
133 #include <bslma_usesbslmaallocator.h>
134 #include <bslmf_nestedtraitdeclaration.h>
135 #include <bsls_annotation.h>
136 #include <bsls_assert.h>
137 #include <bsls_timeinterval.h>
138 #include <bsls_types.h>
150 class HostHealthMonitor;
174 5 * bdlt::TimeUnitRatio::k_SECONDS_PER_MINUTE;
181 bsl::string d_brokerUri;
185 bsl::string d_processNameOverride;
188 int d_numProcessingThreads;
191 int d_blobBufferSize;
194 bsls::Types::Int64 d_channelHighWatermark;
197 bsls::TimeInterval d_statsDumpInterval;
199 bsls::TimeInterval d_connectTimeout;
201 bsls::TimeInterval d_disconnectTimeout;
203 bsls::TimeInterval d_openQueueTimeout;
205 bsls::TimeInterval d_configureQueueTimeout;
208 bsls::TimeInterval d_closeQueueTimeout;
210 int d_eventQueueLowWatermark;
213 int d_eventQueueHighWatermark;
217 int d_eventQueueSize;
219 bsl::shared_ptr<bmqpi::HostHealthMonitor> d_hostHealthMonitor_sp;
221 bsl::shared_ptr<bmqpi::DTContext> d_dtContext_sp;
222 bsl::shared_ptr<bmqpi::DTTracer> d_dtTracer_sp;
226 BSLMF_NESTED_TRAIT_DECLARATION(
SessionOptions, bslma::UsesBslmaAllocator)
237 bslma::Allocator* allocator = 0);
283 const bsl::shared_ptr<bmqpi::HostHealthMonitor>& monitor);
291 const bsl::shared_ptr<bmqpi::DTTracer>& dtTracer);
345 const bsl::shared_ptr<bmqpi::DTContext>&
traceContext() const;
348 const bsl::shared_ptr<bmqpi::DTTracer>&
tracer() const;
367 print(bsl::ostream& stream,
int level = 0,
int spacesPerLevel = 4) const;
384 bsl::ostream& operator<<(bsl::ostream& stream, const
SessionOptions& rhs);
398 d_brokerUri.assign(value.data(), value.length());
405 d_processNameOverride.assign(value.data(), value.length());
411 d_numProcessingThreads = value;
417 d_blobBufferSize = value;
425 BSLS_ASSERT_OPT(8 * 1024 * 1024 < value);
430 d_channelHighWatermark = value;
438 BSLS_ASSERT_OPT(value.seconds() % 30 == 0 &&
439 "value must be a multiple of 30s");
440 BSLS_ASSERT_OPT(value.seconds() <
441 bdlt::TimeUnitRatio::k_SECONDS_PER_HOUR &&
442 "value must be < 10 min");
444 d_statsDumpInterval = value;
451 d_connectTimeout = value;
458 d_disconnectTimeout = value;
465 d_openQueueTimeout = value;
472 d_configureQueueTimeout = value;
479 d_closeQueueTimeout = value;
484 const bsl::shared_ptr<bmqpi::HostHealthMonitor>& monitor)
486 d_hostHealthMonitor_sp = monitor;
491 const bsl::shared_ptr<bmqpi::DTContext>& context,
492 const bsl::shared_ptr<bmqpi::DTTracer>&
tracer)
494 BSLS_ASSERT_OPT((context &&
tracer) || (!context && !
tracer));
496 d_dtContext_sp = context;
505 d_eventQueueSize = queueSize;
513 BSLS_ASSERT_OPT(lowWatermark < highWatermark);
515 d_eventQueueLowWatermark = lowWatermark;
516 d_eventQueueHighWatermark = highWatermark;
529 return d_processNameOverride;
534 return d_numProcessingThreads;
539 return d_blobBufferSize;
544 return d_channelHighWatermark;
549 return d_statsDumpInterval;
554 return d_connectTimeout;
559 return d_disconnectTimeout;
564 return d_openQueueTimeout;
569 return d_configureQueueTimeout;
574 return d_closeQueueTimeout;
577 inline const bsl::shared_ptr<bmqpi::HostHealthMonitor>&
580 return d_hostHealthMonitor_sp;
583 inline const bsl::shared_ptr<bmqpi::DTContext>&
586 return d_dtContext_sp;
591 return d_dtTracer_sp;
596 return d_eventQueueLowWatermark;
601 return d_eventQueueHighWatermark;
606 return d_eventQueueSize;
656 return rhs.
print(stream, 0, -1);
A pure interface for a context with a notion of a current span.
Definition: bmqpi_dtcontext.h:55
Definition: bmqt_sessionoptions.h:161
SessionOptions & setChannelHighWatermark(bsls::Types::Int64 value)
Definition: bmqt_sessionoptions.h:422
bsls::Types::Int64 channelHighWatermark() const
Get the channel high watermark.
Definition: bmqt_sessionoptions.h:542
SessionOptions & setCloseQueueTimeout(const bsls::TimeInterval &value)
Set the timeout for closing a queue to the specified value.
Definition: bmqt_sessionoptions.h:477
int eventQueueSize() const
Definition: bmqt_sessionoptions.h:604
const bsls::TimeInterval & closeQueueTimeout() const
Get the timeout for closing a queue.
Definition: bmqt_sessionoptions.h:572
SessionOptions & setConfigureQueueTimeout(const bsls::TimeInterval &value)
Definition: bmqt_sessionoptions.h:470
int eventQueueHighWatermark() const
Definition: bmqt_sessionoptions.h:599
int numProcessingThreads() const
Get the number of processing threads.
Definition: bmqt_sessionoptions.h:532
SessionOptions & setProcessNameOverride(const bslstl::StringRef &value)
Set an override of the proces name to the specified value.
Definition: bmqt_sessionoptions.h:403
const bsls::TimeInterval & disconnectTimeout() const
Get the timeout for disconnecting from the broker.
Definition: bmqt_sessionoptions.h:557
static const char k_BROKER_DEFAULT_URI[]
Default URI of the bmqbrkr to connect to.
Definition: bmqt_sessionoptions.h:166
int blobBufferSize() const
Get the size of the blobs buffer.
Definition: bmqt_sessionoptions.h:537
SessionOptions & setOpenQueueTimeout(const bsls::TimeInterval &value)
Set the timeout for opening a queue to the specified value.
Definition: bmqt_sessionoptions.h:463
SessionOptions & setBrokerUri(const bslstl::StringRef &value)
Set the broker URI to the specified value.
Definition: bmqt_sessionoptions.h:396
SessionOptions & setTraceOptions(const bsl::shared_ptr< bmqpi::DTContext > &dtContext, const bsl::shared_ptr< bmqpi::DTTracer > &dtTracer)
Definition: bmqt_sessionoptions.h:490
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
const bsl::string & processNameOverride() const
Return the process name override.
Definition: bmqt_sessionoptions.h:527
SessionOptions & setHostHealthMonitor(const bsl::shared_ptr< bmqpi::HostHealthMonitor > &monitor)
Definition: bmqt_sessionoptions.h:483
const bsl::shared_ptr< bmqpi::HostHealthMonitor > & hostHealthMonitor() const
Definition: bmqt_sessionoptions.h:578
static const int k_QUEUE_OPERATION_DEFAULT_TIMEOUT
Definition: bmqt_sessionoptions.h:173
SessionOptions & configureEventQueue(int queueSize, int lowWatermark, int highWatermark)
Definition: bmqt_sessionoptions.h:501
const bsls::TimeInterval & statsDumpInterval() const
Get the stats dump interval.
Definition: bmqt_sessionoptions.h:547
const bsls::TimeInterval & configureQueueTimeout() const
Get the timeout for configuring or disconfiguring a queue.
Definition: bmqt_sessionoptions.h:567
const bsl::string & brokerUri() const
Get the broker URI.
Definition: bmqt_sessionoptions.h:522
static const int k_BROKER_DEFAULT_PORT
Default port the bmqbrkr is listening to for client to connect.
Definition: bmqt_sessionoptions.h:169
SessionOptions & setConnectTimeout(const bsls::TimeInterval &value)
Set the timeout for connecting to the broker to the specified value.
Definition: bmqt_sessionoptions.h:449
const bsl::shared_ptr< bmqpi::DTTracer > & tracer() const
Get the Distributed Trace tracer object.
Definition: bmqt_sessionoptions.h:589
const bsls::TimeInterval & openQueueTimeout() const
Get the timeout for opening a queue.
Definition: bmqt_sessionoptions.h:562
SessionOptions & setStatsDumpInterval(const bsls::TimeInterval &value)
Definition: bmqt_sessionoptions.h:435
const bsl::shared_ptr< bmqpi::DTContext > & traceContext() const
Get the Distributed Trace context object.
Definition: bmqt_sessionoptions.h:584
int eventQueueLowWatermark() const
Definition: bmqt_sessionoptions.h:594
SessionOptions & setNumProcessingThreads(int value)
Set the number of processing threads to the specified value.
Definition: bmqt_sessionoptions.h:409
const bsls::TimeInterval & connectTimeout() const
Get the timeout for connecting to the broker.
Definition: bmqt_sessionoptions.h:552
SessionOptions & setDisconnectTimeout(const bsls::TimeInterval &value)
Definition: bmqt_sessionoptions.h:456
SessionOptions & setBlobBufferSize(int value)
Set the specified value for the size of blobs buffers.
Definition: bmqt_sessionoptions.h:415
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