diff options
Diffstat (limited to 'searchcore/src/apps/proton/proton.cpp')
-rw-r--r-- | searchcore/src/apps/proton/proton.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/searchcore/src/apps/proton/proton.cpp b/searchcore/src/apps/proton/proton.cpp index d7e073c9a56..61536f924a5 100644 --- a/searchcore/src/apps/proton/proton.cpp +++ b/searchcore/src/apps/proton/proton.cpp @@ -185,7 +185,9 @@ App::Main() LOG(debug, "identity: '%s'", params.identity.c_str()); LOG(debug, "serviceidentity: '%s'", params.serviceidentity.c_str()); LOG(debug, "subscribeTimeout: '%" PRIu64 "'", params.subscribeTimeout); - protonUP = std::make_unique<proton::Proton>(params.identity, _argc > 0 ? _argv[0] : "proton", std::chrono::milliseconds(params.subscribeTimeout)); + std::chrono::milliseconds subscribeTimeout(params.subscribeTimeout); + config::ConfigUri identityUri(params.identity); + protonUP = std::make_unique<proton::Proton>(identityUri, _argc > 0 ? _argv[0] : "proton", subscribeTimeout); proton::Proton & proton = *protonUP; proton::BootstrapConfig::SP configSnapshot = proton.init(); if (proton.hasAbortedInit()) { @@ -200,13 +202,14 @@ App::Main() } configSnapshot.reset(); std::unique_ptr<ProtonServiceLayerProcess> spiProton; + if ( ! params.serviceidentity.empty()) { - spiProton = std::make_unique<ProtonServiceLayerProcess>(params.serviceidentity, proton); - spiProton->setupConfig(std::chrono::milliseconds(params.subscribeTimeout)); + spiProton = std::make_unique<ProtonServiceLayerProcess>(identityUri.createWithNewId(params.serviceidentity), proton); + spiProton->setupConfig(subscribeTimeout); spiProton->createNode(); EV_STARTED("servicelayer"); } else { - proton.getMetricManager().init(params.identity, proton.getThreadPool()); + proton.getMetricManager().init(identityUri, proton.getThreadPool()); } EV_STARTED("proton"); while (!(SIG::INT.check() || SIG::TERM.check() || (spiProton && spiProton->getNode().attemptedStopped()))) { |