2020// BMQ
2121#include < bmqex_executionpolicy.h>
2222#include < bmqex_systemexecutor.h>
23- #include < bmqimp_connectionchannelfactory.h>
23+ #include < bmqimp_authenticatedchannelfactory.h>
24+ #include < bmqimp_negotiatedchannelfactory.h>
2425#include < bmqio_channelutil.h>
2526#include < bmqio_connectoptions.h>
2627#include < bmqio_status.h>
@@ -389,7 +390,7 @@ bmqt::GenericResult::Enum Application::startChannel()
389390 .setAttemptInterval (attemptInterval)
390391 .setAutoReconnect (true );
391392
392- d_connectionChannelFactory .connect (
393+ d_negotiatedChannelFactory .connect (
393394 &status,
394395 &d_connectHandle_mp,
395396 options,
@@ -603,11 +604,16 @@ Application::Application(
603604 bdlf::PlaceHolders::_2), // handle
604605 allocator),
605606 allocator)
606- , d_connectionChannelFactory(
607- ConnectionChannelFactoryConfig (&d_statChannelFactory,
607+ , d_authenticatedChannelFactory(
608+ AuthenticatedChannelFactoryConfig (&d_statChannelFactory,
609+ sessionOptions.authnCredentialCb(),
610+ sessionOptions.connectTimeout(),
611+ d_blobSpPool_sp.get(),
612+ allocator))
613+ , d_negotiatedChannelFactory(
614+ NegotiatedChannelFactoryConfig (&d_authenticatedChannelFactory,
608615 negotiationMessage,
609616 sessionOptions.connectTimeout(),
610- sessionOptions.authnCredentialCb(),
611617 d_blobSpPool_sp.get(),
612618 allocator),
613619 allocator)
@@ -719,16 +725,8 @@ int Application::start(const bsls::TimeInterval& timeout)
719725 << " ::: START (SYNC) << [state: " << d_brokerSession.state ()
720726 << " ] :::" ;
721727
722- int rc = d_connectionChannelFactory .start ();
728+ int rc = d_brokerSession .start (timeout );
723729 if (rc != 0 ) {
724- BALL_LOG_ERROR << id () << " Failed to start connectionChannelFactory "
725- << " [rc: " << rc << " ]" ;
726- return rc; // RETURN
727- }
728-
729- rc = d_brokerSession.start (timeout);
730- if (rc != 0 ) {
731- d_connectionChannelFactory.stop ();
732730 return rc; // RETURN
733731 }
734732
@@ -767,9 +765,6 @@ void Application::stop()
767765
768766 // Stop the brokerSession
769767 d_brokerSession.stop ();
770-
771- // Stop the channel factories
772- d_connectionChannelFactory.stop ();
773768}
774769
775770void Application::stopAsync ()
@@ -791,7 +786,7 @@ Application::createMonitor(const bsl::shared_ptr<bmqio::Channel>& channel)
791786
792787 channel->properties ().load (
793788 &maxMissedHeartbeats,
794- ConnectionChannelFactory ::k_CHANNEL_PROPERTY_MAX_MISSED_HEARTBEATS);
789+ NegotiatedChannelFactory ::k_CHANNEL_PROPERTY_MAX_MISSED_HEARTBEATS);
795790
796791 bsl::shared_ptr<bmqp::HeartbeatMonitor> monitor (
797792 new (d_allocator) bmqp::HeartbeatMonitor (maxMissedHeartbeats),
@@ -814,7 +809,7 @@ void Application::startHeartbeat(
814809
815810 channel->properties ().load (
816811 &heartbeatIntervalMs,
817- ConnectionChannelFactory ::k_CHANNEL_PROPERTY_HEARTBEAT_INTERVAL_MS);
812+ NegotiatedChannelFactory ::k_CHANNEL_PROPERTY_HEARTBEAT_INTERVAL_MS);
818813
819814 bsls::TimeInterval interval;
820815 interval.addMilliseconds (heartbeatIntervalMs);
0 commit comments