diff --git a/ArmoniK.SDK.Client/src/ChannelPool.cpp b/ArmoniK.SDK.Client/src/ChannelPool.cpp index 8b2ce07..7ae37a9 100644 --- a/ArmoniK.SDK.Client/src/ChannelPool.cpp +++ b/ArmoniK.SDK.Client/src/ChannelPool.cpp @@ -1,5 +1,6 @@ #include "ChannelPool.h" +#include #include #include #include @@ -28,16 +29,11 @@ std::shared_ptr ChannelPool::AcquireChannel() { return channel; } } - std::string endpoint(properties_.configuration.get_control_plane().getEndpoint()); - auto scheme_delim = endpoint.find("://"); - if (scheme_delim != std::string::npos) { - endpoint = endpoint.substr(scheme_delim + 3); - } - // TODO Handle TLS/mTLS - channel = grpc::CreateCustomChannel( - endpoint, grpc::InsecureChannelCredentials(), - armonik::api::common::utils::getChannelArguments( - static_cast(properties_.configuration))); + armonik::api::common::logger::Logger logger{armonik::api::common::logger::writer_console(), + armonik::api::common::logger::formatter_plain(true)}; + armonik::api::client::ChannelFactory channelFactory( + static_cast(properties_.configuration), logger); + channel = channelFactory.create_channel(); logger_.log(armonik::api::common::logger::Level::Debug, "Created and acquired new channel from pool"); return channel; }