@@ -351,16 +351,16 @@ struct BuildAckOverflowFunctor {
351351// -------------------------
352352
353353ClientSessionState::ClientSessionState (
354- bslma::ManagedPtr <bmqst::StatContext>& clientStatContext,
355- BlobSpPool* blobSpPool,
356- bdlbb::BlobBufferFactory* bufferFactory,
357- bmqp::EncodingType::Enum encodingType,
358- bslma::Allocator* allocator)
354+ const bsl::shared_ptr <bmqst::StatContext>& clientStatContext,
355+ BlobSpPool* blobSpPool,
356+ bdlbb::BlobBufferFactory* bufferFactory,
357+ bmqp::EncodingType::Enum encodingType,
358+ bslma::Allocator* allocator)
359359: d_allocator_p(allocator)
360360, d_channelBufferQueue(allocator)
361361, d_unackedMessageInfos(d_allocator_p)
362362, d_dispatcherClientData()
363- , d_statContext_mp (clientStatContext)
363+ , d_statContext_sp (clientStatContext)
364364, d_bufferFactory_p(bufferFactory)
365365, d_blobSpPool_p(blobSpPool)
366366, d_schemaEventBuilder(blobSpPool, encodingType, allocator)
@@ -668,7 +668,7 @@ void ClientSession::sendAck(bmqt::AckResult::Enum status,
668668 queueStats = invalidQueueStats ();
669669 }
670670 else {
671- queueStats = subQueueCiter->value ().d_stats .get ();
671+ queueStats = subQueueCiter->value ().d_stats_sp .get ();
672672 }
673673 }
674674
@@ -1667,23 +1667,10 @@ bool ClientSession::validateMessage(mqbi::QueueHandle** queueHandle,
16671667 return false ; // RETURN
16681668 }
16691669
1670- StreamsMap::iterator subQueueIt =
1671- queueIt->second .d_subQueueInfosMap .findBySubIdSafe (queueId.subId ());
1672- if (BSLS_PERFORMANCEHINT_PREDICT_UNLIKELY (
1673- subQueueIt == queueIt->second .d_subQueueInfosMap .end ())) {
1674- BSLS_PERFORMANCEHINT_UNLIKELY_HINT;
1675-
1676- if (eventType == bmqp::EventType::e_CONFIRM) {
1677- // Update invalid queue stats
1678- invalidQueueStats ()->onEvent (
1679- mqbstat::QueueStatsClient::EventType::e_CONFIRM,
1680- 1 );
1681- }
1682-
1683- *errorStream << " for an unknown subQueueId" ;
1684-
1685- return false ; // RETURN
1686- }
1670+ // Do not lookup 'queueId.subId()'.
1671+ // 'QueueHandle::confirmMessageDispatched' does the check.
1672+ // Note, that it does not update stats (on "bmq://invalid/queue").
1673+ // It does log warnings.
16871674
16881675 *queueHandle = queueIt->second .d_handle_p ;
16891676 BSLS_ASSERT_SAFE (queueHandle);
@@ -1729,13 +1716,6 @@ bool ClientSession::validateMessage(mqbi::QueueHandle** queueHandle,
17291716 return false ; // RETURN
17301717 }
17311718
1732- if (eventType == bmqp::EventType::e_CONFIRM) {
1733- // Update stats for the queue (or subStream of the queue)
1734- subQueueIt->value ().d_stats ->onEvent (
1735- mqbstat::QueueStatsClient::EventType::e_CONFIRM,
1736- 1 );
1737- }
1738-
17391719 return true ;
17401720}
17411721
@@ -1877,7 +1857,7 @@ void ClientSession::onPushEvent(const mqbi::DispatcherPushEvent& event)
18771857 blob->length ());
18781858 }
18791859 else {
1880- subQueueCiter->value ().d_stats -> onEvent (
1860+ subQueueCiter->value ().onEvent (
18811861 mqbstat::QueueStatsClient::EventType::e_PUSH,
18821862 blob->length ());
18831863 }
@@ -2028,9 +2008,8 @@ void ClientSession::onPutEvent(const mqbi::DispatcherPutEvent& event)
20282008 BSLS_ASSERT_SAFE (queueStatePtr && subQueueInfoPtr);
20292009 BSLS_ASSERT_SAFE (queueStatePtr->d_handle_p );
20302010
2031- subQueueInfoPtr->d_stats ->onEvent (
2032- mqbstat::QueueStatsClient::EventType::e_PUT,
2033- appDataSp->length ());
2011+ subQueueInfoPtr->onEvent (mqbstat::QueueStatsClient::EventType::e_PUT,
2012+ appDataSp->length ());
20342013
20352014 const bool isAtMostOnce =
20362015 queueStatePtr->d_handle_p ->queue ()->isAtMostOnce ();
@@ -2197,7 +2176,7 @@ mqbstat::QueueStatsClient* ClientSession::invalidQueueStats()
21972176 d_state.d_invalidQueueStats .makeValue ();
21982177 d_state.d_invalidQueueStats .value ().initialize (
21992178 " bmq://invalid/queue" ,
2200- d_state.d_statContext_mp .get (),
2179+ d_state.d_statContext_sp .get (),
22012180 d_state.d_allocator_p );
22022181 // TBD: The queue uri should be '** INVALID QUEUE **', but that can
22032182 // only be done once the stats UI panel has been updated to
@@ -2400,17 +2379,17 @@ bool ClientSession::validatePutMessage(QueueState** queueState,
24002379
24012380// CREATORS
24022381ClientSession::ClientSession (
2403- const bsl::shared_ptr<bmqio::Channel>& channel,
2404- const bmqp_ctrlmsg::NegotiationMessage& negotiationMessage,
2405- const bsl::string& sessionDescription,
2406- mqbi::Dispatcher* dispatcher,
2407- mqbblp::ClusterCatalog* clusterCatalog,
2408- mqbi::DomainFactory* domainFactory,
2409- bslma::ManagedPtr <bmqst::StatContext>& clientStatContext,
2410- ClientSessionState::BlobSpPool* blobSpPool,
2411- bdlbb::BlobBufferFactory* bufferFactory,
2412- bdlmt::EventScheduler* scheduler,
2413- bslma::Allocator* allocator)
2382+ const bsl::shared_ptr<bmqio::Channel>& channel,
2383+ const bmqp_ctrlmsg::NegotiationMessage& negotiationMessage,
2384+ const bsl::string& sessionDescription,
2385+ mqbi::Dispatcher* dispatcher,
2386+ mqbblp::ClusterCatalog* clusterCatalog,
2387+ mqbi::DomainFactory* domainFactory,
2388+ const bsl::shared_ptr <bmqst::StatContext>& clientStatContext,
2389+ ClientSessionState::BlobSpPool* blobSpPool,
2390+ bdlbb::BlobBufferFactory* bufferFactory,
2391+ bdlmt::EventScheduler* scheduler,
2392+ bslma::Allocator* allocator)
24142393: d_self(this ) // use default allocator
24152394, d_operationState(e_RUNNING)
24162395, d_isDisconnecting(false )
@@ -2431,7 +2410,7 @@ ClientSession::ClientSession(
24312410 allocator)
24322411, d_queueSessionManager(this ,
24332412 *d_clientIdentity_p,
2434- d_state.d_statContext_mp.get() ,
2413+ d_state.d_statContext_sp ,
24352414 domainFactory,
24362415 allocator)
24372416, d_clusterCatalog_p(clusterCatalog)
0 commit comments