From a73ec3c391a53d64b569736c7ea3d7918f1b6438 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Wed, 13 Jan 2021 11:43:42 +0100 Subject: [PATCH] DPL utils: allow customising output-proxy (#5165) --- Framework/Utils/src/dpl-output-proxy.cxx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Framework/Utils/src/dpl-output-proxy.cxx b/Framework/Utils/src/dpl-output-proxy.cxx index d7941cc520778..caf610b62c0dd 100644 --- a/Framework/Utils/src/dpl-output-proxy.cxx +++ b/Framework/Utils/src/dpl-output-proxy.cxx @@ -28,6 +28,14 @@ void customize(std::vector& workflowOptions) ConfigParamSpec{ "dataspec", VariantType::String, "dpl-output-proxy:TST/CLUSTERS;dpl-output-proxy:TST/TRACKS", {"selection string for the data to be proxied"}}); + workflowOptions.push_back( + ConfigParamSpec{ + "output-proxy-method", VariantType::String, "bind", {"proxy socket method: bind, connect"}}); + + workflowOptions.push_back( + ConfigParamSpec{ + "output-proxy-address", VariantType::String, "0.0.0.0", {"address to connect / bind to"}}); + workflowOptions.push_back( ConfigParamSpec{ "default-transport", VariantType::String, "shmem", {"default transport: shmem, zeromq"}}); @@ -65,8 +73,12 @@ WorkflowSpec defineDataProcessing(ConfigContext const& config) OutputChannelSpec externalChannelSpec; externalChannelSpec.name = "downstream"; externalChannelSpec.type = ChannelType::Push; - externalChannelSpec.method = ChannelMethod::Bind; - externalChannelSpec.hostname = "localhost"; + if (config.options().get("output-proxy-method") == "bind") { + externalChannelSpec.method = ChannelMethod::Bind; + } else if (config.options().get("output-proxy-method") == "connect") { + externalChannelSpec.method = ChannelMethod::Connect; + } + externalChannelSpec.hostname = config.options().get("output-proxy-address"); externalChannelSpec.port = defaultPort; externalChannelSpec.listeners = 0; // in principle, protocol and transport are two different things but fur simplicity