From 1cb99ddb28ea54d2944439dd00cc6b8a2ff4bd1e Mon Sep 17 00:00:00 2001
From: Carsten Patzke <carsten.patzke@desy.de>
Date: Fri, 4 Sep 2020 17:38:12 +0200
Subject: [PATCH] Auto fallback to TCP when Fabric connection is not working

---
 .../common/fabric_context_impl.cpp            |  2 +-
 .../asapo_fabric/common/fabric_context_impl.h |  1 +
 .../api/cpp/include/consumer/data_broker.h    |  5 +-
 consumer/api/cpp/src/data_broker.cpp          | 24 +------
 .../api/cpp/unittests/test_consumer_api.cpp   | 23 +------
 consumer/api/python/asapo_consumer.pxd        |  2 +-
 consumer/api/python/asapo_consumer.pyx.in     | 15 ++--
 .../consumer/getnext_broker/check_linux.sh    |  2 +-
 .../consumer/getnext_broker/check_windows.bat |  2 +-
 .../getnext_broker/getnext_broker.cpp         | 48 ++++++-------
 .../getnext_broker_python/check_linux.sh      |  4 +-
 .../getnext_broker_python/check_windows.bat   |  8 +--
 .../consumer/getnext_broker_python/getnext.py |  4 +-
 examples/pipeline/in_to_out/check_linux.sh    |  4 +-
 examples/pipeline/in_to_out/check_windows.bat |  4 +-
 examples/pipeline/in_to_out/in_to_out.cpp     | 26 ++++---
 .../pipeline/in_to_out_python/check_linux.sh  |  2 +-
 .../in_to_out_python/check_windows.bat        |  2 +-
 .../pipeline/in_to_out_python/in_to_out.py    |  4 +-
 .../consumer_python_memleak/check_linux.sh    |  2 +-
 .../consumer_python_memleak/memleak.py        |  4 +-
 .../check_windows.bat                         |  2 +-
 .../consumer/consumer_api/check_linux.sh      |  4 +-
 .../consumer/consumer_api/check_windows.bat   |  4 +-
 .../consumer/consumer_api/consumer_api.cpp    | 14 ++--
 .../consumer_api_python/check_linux.sh        |  4 +-
 .../consumer_api_python/check_windows.bat     |  4 +-
 .../consumer_api_python/consumer_api.py       |  9 +--
 .../next_multithread_broker/check_linux.sh    |  2 +-
 .../next_multithread_broker/check_windows.bat |  2 +-
 .../next_multithread_broker.cpp               | 17 ++---
 .../curl_http_client_command/check_linux.sh   |  2 +-
 .../check_windows.bat                         |  2 +-
 .../curl_httpclient_command.cpp               | 13 ++--
 .../send_recv_substreams/check_linux.sh       |  6 +-
 .../send_recv_substreams/check_windows.bat    |  2 +-
 .../send_recv_substreams.cpp                  | 12 ++--
 .../CMakeLists.txt                            |  2 +-
 .../check_linux.sh                            |  6 +-
 .../check_windows.bat                         |  2 +-
 .../send_recv_substreams.py                   |  6 +-
 .../full_chain/simple_chain/CMakeLists.txt    |  6 +-
 .../full_chain/simple_chain/check_linux.sh    | 11 ++-
 .../full_chain/simple_chain/check_windows.bat |  2 +-
 .../simple_chain_dataset/check_linux.sh       |  9 +--
 .../simple_chain_dataset/check_windows.bat    |  2 +-
 .../simple_chain_filegen/check_linux.sh       |  6 +-
 .../simple_chain_filegen/check_windows.bat    |  2 +-
 .../check_linux.sh                            | 11 +--
 .../check_windows.bat                         |  2 +-
 .../CMakeLists.txt                            |  2 +-
 .../check_linux.sh                            | 10 +--
 .../check_windows.bat                         |  9 ++-
 .../check_linux.sh                            |  2 +-
 .../check_windows.bat                         |  2 +-
 .../check_linux.sh                            |  3 +-
 .../check_windows.bat                         |  3 +-
 .../simple_chain_metadata/CMakeLists.txt      |  2 +-
 .../simple_chain_metadata/check_linux.sh      | 10 +--
 .../simple_chain_metadata/check_windows.bat   |  2 +-
 .../CMakeLists.txt                            |  2 +-
 .../check_linux.sh                            | 11 ++-
 .../check_windows.bat                         |  2 +-
 .../get_user_meta.py                          |  8 +--
 .../full_chain/two_beamlines/CMakeLists.txt   |  1 +
 .../full_chain/two_beamlines/check_linux.sh   | 12 +++-
 .../two_beamlines/check_windows.bat           |  4 +-
 .../full_chain/two_streams/check_linux.sh     | 10 ++-
 .../full_chain/two_streams/check_windows.bat  |  4 +-
 .../broker_mongo_restart/check_linux.sh       |  2 +-
 .../services_restart/check_linux.sh           |  2 +-
 .../getlast_broker.cpp                        | 69 +++++++++++++++----
 .../performance_full_chain_simple/test.sh     |  1 +
 .../python_tests/consumer/consumer_api.py     |  4 +-
 tests/manual/python_tests/consumer/test.sh    |  2 +-
 .../python_tests/consumer/test_asap3.sh       |  2 +-
 .../manual/python_tests/consumer/test_k8s.sh  |  2 +-
 77 files changed, 269 insertions(+), 268 deletions(-)

diff --git a/common/cpp/src/asapo_fabric/common/fabric_context_impl.cpp b/common/cpp/src/asapo_fabric/common/fabric_context_impl.cpp
index eaf0369ef..a57b439ac 100644
--- a/common/cpp/src/asapo_fabric/common/fabric_context_impl.cpp
+++ b/common/cpp/src/asapo_fabric/common/fabric_context_impl.cpp
@@ -326,5 +326,5 @@ void FabricContextImpl::InternalWaitWithAliveCheck(FabricAddress targetAddress,
 void FabricContextImpl::CancelTask(FabricWaitableTask* task, Error* error) {
     *error = nullptr;
     fi_cancel(&endpoint_->fid, task);
-    task->Wait(0, error); // You can probably expect a kInternalOperationCanceledError
+    task->Wait(taskCancelTimeout_, error); // You can probably expect a kInternalOperationCanceledError
 }
diff --git a/common/cpp/src/asapo_fabric/common/fabric_context_impl.h b/common/cpp/src/asapo_fabric/common/fabric_context_impl.h
index 144b6c22b..b6db94a94 100644
--- a/common/cpp/src/asapo_fabric/common/fabric_context_impl.h
+++ b/common/cpp/src/asapo_fabric/common/fabric_context_impl.h
@@ -61,6 +61,7 @@ class FabricContextImpl : public FabricContext {
     uint64_t requestEnqueueTimeoutMs_ = 10000; // 10 sec for queuing a task
     uint64_t requestTimeoutMs_ = 20000; // 20 sec to complete a task, otherwise a ping will be send
     uint64_t requestFastTimeoutMs_ = 7000; // All task that dont have use keepalive check will try to fail fast
+    uint64_t taskCancelTimeout_ = 5000; // The time it takes to timeout a cancel request
     uint32_t maxTimeoutRetires_ = 5; // Timeout retires, if one of them fails, the task will fail with a timeout
 
     std::unique_ptr<std::thread> completion_thread_;
diff --git a/consumer/api/cpp/include/consumer/data_broker.h b/consumer/api/cpp/include/consumer/data_broker.h
index 48dd9c90b..96da11916 100644
--- a/consumer/api/cpp/include/consumer/data_broker.h
+++ b/consumer/api/cpp/include/consumer/data_broker.h
@@ -180,12 +180,11 @@ class DataBroker {
     virtual ~DataBroker() = default; // needed for unique_ptr to delete itself
 };
 
-/*! A class to create a data broker instance. The class's only function Create is used for this*/
+/*! A class to create a data broker instance. The class's only function Create is used for this */
 class DataBrokerFactory {
   public:
     static std::unique_ptr<DataBroker> CreateServerBroker(std::string server_name, std::string source_path,
-            bool has_filesystem, SourceCredentials source, std::string networkType,
-            Error* error) noexcept;
+            bool has_filesystem, SourceCredentials source, Error* error) noexcept;
 
 };
 
diff --git a/consumer/api/cpp/src/data_broker.cpp b/consumer/api/cpp/src/data_broker.cpp
index 64d4ac8e9..7ab6f2c04 100644
--- a/consumer/api/cpp/src/data_broker.cpp
+++ b/consumer/api/cpp/src/data_broker.cpp
@@ -27,27 +27,9 @@ std::unique_ptr<DataBroker> Create(const std::string& source_name,
 }
 
 std::unique_ptr<DataBroker> DataBrokerFactory::CreateServerBroker(std::string server_name, std::string source_path,
-        bool has_filesystem, SourceCredentials source, std::string networkType,
-        Error* error) noexcept {
-    NetworkConnectionType networkConnectionType;
-    if (networkType == "tcp") {
-        networkConnectionType = NetworkConnectionType::kAsapoTcp;
-    } else if (networkType == "fabric") {
-        networkConnectionType = NetworkConnectionType::kFabric;
-    } else {
-        *error = TextError("Unknown network type");
-        return nullptr;
-    }
-
-    auto broker = Create<ServerDataBroker>(std::move(server_name), error, std::move(source_path), has_filesystem,
-                                           std::move(source));
-
-    // TODO: This is just here to test the old code. Will be removed with the next commit.
-    if (networkConnectionType == NetworkConnectionType::kAsapoTcp) {
-        broker->ForceNoRdma();
-    }
-
-    return broker;
+        bool has_filesystem, SourceCredentials source, Error* error) noexcept {
+    return Create<ServerDataBroker>(std::move(server_name), error, std::move(source_path), has_filesystem,
+                                    std::move(source));
 }
 
 
diff --git a/consumer/api/cpp/unittests/test_consumer_api.cpp b/consumer/api/cpp/unittests/test_consumer_api.cpp
index 9645c58d0..90e5b0b01 100644
--- a/consumer/api/cpp/unittests/test_consumer_api.cpp
+++ b/consumer/api/cpp/unittests/test_consumer_api.cpp
@@ -25,32 +25,13 @@ class DataBrokerFactoryTests : public Test {
 };
 
 
-TEST_F(DataBrokerFactoryTests, CreateServerDataSource_tcp) {
+TEST_F(DataBrokerFactoryTests, CreateServerDataSource) {
 
-    auto data_broker = DataBrokerFactory::CreateServerBroker("server", "path", false, asapo::SourceCredentials{"beamtime_id", "", "", "token"},
-                       "tcp", &error);
+    auto data_broker = DataBrokerFactory::CreateServerBroker("server", "path", false, asapo::SourceCredentials{"beamtime_id", "", "", "token"}, &error);
 
     ASSERT_THAT(error, Eq(nullptr));
     ASSERT_THAT(dynamic_cast<ServerDataBroker*>(data_broker.get()), Ne(nullptr));
 }
 
-TEST_F(DataBrokerFactoryTests, CreateServerDataSource_fabric) {
-
-    auto data_broker = DataBrokerFactory::CreateServerBroker("server", "path", false, asapo::SourceCredentials{"beamtime_id", "", "", "token"},
-                       "fabric", &error);
-
-    ASSERT_THAT(error, Eq(nullptr));
-    ASSERT_THAT(dynamic_cast<ServerDataBroker*>(data_broker.get()), Ne(nullptr));
-}
-
-TEST_F(DataBrokerFactoryTests, CreateServerDataSource_invalid) {
-
-    auto data_broker = DataBrokerFactory::CreateServerBroker("server", "path", false, asapo::SourceCredentials{"beamtime_id", "", "", "token"},
-                       "test", &error);
-
-    ASSERT_THAT(error, Ne(nullptr));
-    ASSERT_THAT(dynamic_cast<ServerDataBroker*>(data_broker.get()), Eq(nullptr));
-}
-
 
 }
diff --git a/consumer/api/python/asapo_consumer.pxd b/consumer/api/python/asapo_consumer.pxd
index 1e0cd28fa..73ae43e39 100644
--- a/consumer/api/python/asapo_consumer.pxd
+++ b/consumer/api/python/asapo_consumer.pxd
@@ -80,7 +80,7 @@ cdef extern from "asapo_consumer.h" namespace "asapo" nogil:
 cdef extern from "asapo_consumer.h" namespace "asapo" nogil:
     cdef cppclass DataBrokerFactory:
         DataBrokerFactory() except +
-        unique_ptr[DataBroker] CreateServerBroker(string server_name,string source_path,bool has_filesystem,SourceCredentials source,string network_type,Error* error)
+        unique_ptr[DataBroker] CreateServerBroker(string server_name,string source_path,bool has_filesystem,SourceCredentials source,Error* error)
 
 
 cdef extern from "asapo_consumer.h" namespace "asapo":
diff --git a/consumer/api/python/asapo_consumer.pyx.in b/consumer/api/python/asapo_consumer.pyx.in
index 5f20dbe3c..c733753fc 100644
--- a/consumer/api/python/asapo_consumer.pyx.in
+++ b/consumer/api/python/asapo_consumer.pyx.in
@@ -168,9 +168,9 @@ cdef class PyDataBroker:
         cdef int cased = <int>connection_type
         cdef string result = "Unknown"
         if cased == <int>NetworkConnectionType_kUndefined:
-            result = "Undefined"
+            result = "No connection"
         elif cased == <int>NetworkConnectionType_kAsapoTcp:
-            result = "AsapoTcp"
+            result = "TCP"
         elif cased == <int>NetworkConnectionType_kFabric:
             result = "Fabric"
         return result.decode('utf-8')
@@ -303,7 +303,7 @@ cdef class __PyDataBrokerFactory:
     def __cinit__(self):
         with nogil:
             self.c_factory = DataBrokerFactory()
-    def create_server_broker(self,server_name,source_path,has_filesystem,beamtime_id,stream,token,timeout,network_type):
+    def create_server_broker(self,server_name,source_path,has_filesystem,beamtime_id,stream,token,timeout):
         cdef string b_server_name = _bytes(server_name)
         cdef string b_source_path = _bytes(source_path)
         cdef bool b_has_filesystem = has_filesystem
@@ -311,11 +311,10 @@ cdef class __PyDataBrokerFactory:
         source.beamtime_id = _bytes(beamtime_id)
         source.user_token = _bytes(token)
         source.stream = _bytes(stream)
-        cdef string b_network_type = _bytes(network_type)
         cdef Error err
         cdef unique_ptr[DataBroker] c_broker
         with nogil:
-            c_broker = self.c_factory.CreateServerBroker(b_server_name,b_source_path,b_has_filesystem,source,b_network_type,&err)
+            c_broker = self.c_factory.CreateServerBroker(b_server_name,b_source_path,b_has_filesystem,source,&err)
         broker = PyDataBroker()
         broker.c_broker =  c_broker.release()
         broker.c_broker.SetTimeout(timeout)
@@ -323,7 +322,7 @@ cdef class __PyDataBrokerFactory:
             throw_exception(err)
         return broker
 
-def create_server_broker(server_name,source_path,has_filesystem,beamtime_id,stream,token,timeout_ms,network_type):
+def create_server_broker(server_name,source_path,has_filesystem,beamtime_id,stream,token,timeout_ms):
     """
       :param server_name: Server endpoint (hostname:port)
       :type server_name: string
@@ -331,13 +330,11 @@ def create_server_broker(server_name,source_path,has_filesystem,beamtime_id,stre
       :type source_path: string
       :param has_filesystem: True if the source_path is accessible locally, otherwise will use file transfer service to get data
       :type has_filesystem: bool
-      :param network_type: The networking mode that should be used. Can be "tcp" or "fabric".
-      :type network_type: string
       :return: Broker object and error. (None,err) if case of error, (broker, None) if success
       :rtype: Tuple with broker object and error.
 	"""
     factory = __PyDataBrokerFactory()
-    return factory.create_server_broker(_bytes(server_name),_bytes(source_path),has_filesystem, _bytes(beamtime_id),_bytes(stream),_bytes(token),timeout_ms,_bytes(network_type))
+    return factory.create_server_broker(_bytes(server_name),_bytes(source_path),has_filesystem, _bytes(beamtime_id),_bytes(stream),_bytes(token),timeout_ms)
 
 
 __version__ = "@PYTHON_ASAPO_VERSION@@ASAPO_VERSION_COMMIT@"
diff --git a/examples/consumer/getnext_broker/check_linux.sh b/examples/consumer/getnext_broker/check_linux.sh
index 501af6825..01b701c9b 100644
--- a/examples/consumer/getnext_broker/check_linux.sh
+++ b/examples/consumer/getnext_broker/check_linux.sh
@@ -30,7 +30,7 @@ done
 
 sleep 1
 
-$@ 127.0.0.1:8400 tcp $source_path $beamtime_id 2 $token_test_run 12000 1  | tee /dev/stderr | grep "Processed 3 file(s)"
+$@ 127.0.0.1:8400 $source_path $beamtime_id 2 $token_test_run 12000 1  | tee /dev/stderr | grep "Processed 3 file(s)"
 
 
 
diff --git a/examples/consumer/getnext_broker/check_windows.bat b/examples/consumer/getnext_broker/check_windows.bat
index 8dcbc3182..6945e1dba 100644
--- a/examples/consumer/getnext_broker/check_windows.bat
+++ b/examples/consumer/getnext_broker/check_windows.bat
@@ -12,7 +12,7 @@ call start_services.bat
 for /l %%x in (1, 1, 3) do echo db.data_default.insert({"_id":%%x,"size":100,"name":"%%x","lastchange":1,"source":"none","buf_id":0,"meta":{"test":10}}) | %mongo_exe% %database_name%  || goto :error
 
 
-"%1" 127.0.0.1:8400 tcp %source_path% %beamtime_id% 1 %token_test_run% 12000 1 | findstr /c:"Processed 3 file" || goto :error
+"%1" 127.0.0.1:8400 %source_path% %beamtime_id% 1 %token_test_run% 12000 1 | findstr /c:"Processed 3 file" || goto :error
 goto :clean
 
 :error
diff --git a/examples/consumer/getnext_broker/getnext_broker.cpp b/examples/consumer/getnext_broker/getnext_broker.cpp
index 1cd9f7fc5..aa9365c8d 100644
--- a/examples/consumer/getnext_broker/getnext_broker.cpp
+++ b/examples/consumer/getnext_broker/getnext_broker.cpp
@@ -4,7 +4,6 @@
 #include <algorithm>
 #include <thread>
 #include <chrono>
-#include <iomanip>
 #include <numeric>
 #include <mutex>
 #include <string>
@@ -35,7 +34,6 @@ inline std::string ConnectionTypeToString(asapo::NetworkConnectionType type) {
 
 struct Args {
     std::string server;
-    std::string network_type;
     std::string file_path;
     std::string beamtime_id;
     std::string stream;
@@ -68,7 +66,7 @@ std::vector<std::thread> StartThreads(const Args& params,
         asapo::FileInfo fi;
         Error err;
         auto broker = asapo::DataBrokerFactory::CreateServerBroker(params.server, params.file_path, true,
-                      asapo::SourceCredentials{params.beamtime_id, "", params.stream, params.token}, params.network_type, &err);
+                      asapo::SourceCredentials{params.beamtime_id, "", params.stream, params.token}, &err);
         if (err) {
             std::cout << "Error CreateServerBroker: " << err << std::endl;
             exit(EXIT_FAILURE);
@@ -123,11 +121,9 @@ std::vector<std::thread> StartThreads(const Args& params,
             }
 
             if (err) {
-                (*errors)[i] += ProcessError(err);
-                if (err) {
-                    std::cout << "Thread exit: " << i << std::endl;
-                    break;
-                }
+                (*errors)[i] += ProcessError(err); // If the error is significant it will be printed here
+                std::cout << "Thread exit: " << i << std::endl;
+                break;
             }
             (*nfiles)[i]++;
         }
@@ -143,7 +139,7 @@ std::vector<std::thread> StartThreads(const Args& params,
 }
 
 int ReadAllData(const Args& params, uint64_t* duration_ms, int* nerrors, int* nbuf, int* nfiles_total,
-                asapo::NetworkConnectionType* connectionType) {
+                asapo::NetworkConnectionType* connection_type) {
     asapo::FileInfo fi;
     system_clock::time_point t1 = system_clock::now();
 
@@ -175,9 +171,9 @@ int ReadAllData(const Args& params, uint64_t* duration_ms, int* nerrors, int* nb
             }
         }
 
-        *connectionType = connection_types[firstThreadThatActuallyProcessedData];
+        *connection_type = connection_types[firstThreadThatActuallyProcessedData];
         for (int i = 0; i < params.nthreads; i++) {
-            if (*connectionType != connection_types[i] && nfiles[i] > 0) {
+            if (*connection_type != connection_types[i] && nfiles[i] > 0) {
                 // The output will look like this:
                 // ERROR thread[0](processed 5 files) connection type is 'No connection' but thread[1](processed 3 files) is 'TCP'
 
@@ -185,7 +181,7 @@ int ReadAllData(const Args& params, uint64_t* duration_ms, int* nerrors, int* nb
                           ConnectionTypeToString(connection_types[i]) << "' but thread["
                           << firstThreadThatActuallyProcessedData << "](processed "
                           << nfiles[firstThreadThatActuallyProcessedData] << " files) is '" << ConnectionTypeToString(
-                              *connectionType) << "'" << std::endl;
+                              *connection_type) << "'" << std::endl;
             }
         }
     }
@@ -217,25 +213,31 @@ int main(int argc, char* argv[]) {
     asapo::ExitAfterPrintVersionIfNeeded("GetNext Broker Example", argc, argv);
     Args params;
     params.datasets = false;
-    if (argc != 9 && argc != 10) {
+    if (argc != 8 && argc != 9) {
         std::cout << "Usage: " + std::string{argv[0]}
-                  + " <server> <network_type> <files_path> <run_name> <nthreads> <token> <timeout ms> <metaonly> [use datasets]"
+                  + " <server> <files_path> <run_name> <nthreads> <token> <timeout ms> <metaonly> [use datasets]"
                   <<
                   std::endl;
         exit(EXIT_FAILURE);
     }
     params.server = std::string{argv[1]};
-    params.network_type = std::string{argv[2]};
-    params.file_path = std::string{argv[3]};
-    params.beamtime_id = std::string{argv[4]};
+    params.file_path = std::string{argv[2]};
+    params.beamtime_id = std::string{argv[3]};
     TryGetStream(&params);
-    params.nthreads = atoi(argv[5]);
-    params.token = std::string{argv[6]};
-    params.timeout_ms = atoi(argv[7]);
-    params.read_data = atoi(argv[8]) != 1;
-    if (argc == 10) {
-        params.datasets = atoi(argv[9]) == 1;
+    params.nthreads = atoi(argv[4]);
+    params.token = std::string{argv[5]};
+    params.timeout_ms = atoi(argv[6]);
+    params.read_data = atoi(argv[7]) != 1;
+    if (argc == 9) {
+        params.datasets = atoi(argv[8]) == 1;
     }
+
+    if (params.read_data) {
+        std::cout << "Will read metadata+payload" << std::endl;
+    } else {
+        std::cout << "Will only read metadata" << std::endl;
+    }
+
     uint64_t duration_ms;
     int nerrors, nbuf, nfiles_total;
     asapo::NetworkConnectionType connectionType;
diff --git a/examples/consumer/getnext_broker_python/check_linux.sh b/examples/consumer/getnext_broker_python/check_linux.sh
index ea6fb7e59..b1a508025 100644
--- a/examples/consumer/getnext_broker_python/check_linux.sh
+++ b/examples/consumer/getnext_broker_python/check_linux.sh
@@ -36,13 +36,13 @@ export PYTHONPATH=$1:${PYTHONPATH}
 Python_EXECUTABLE=$2
 
 
-$Python_EXECUTABLE getnext.py 127.0.0.1:8400 tcp $source_path $beamtime_id $token_test_run $group_id > out
+$Python_EXECUTABLE getnext.py 127.0.0.1:8400 $source_path $beamtime_id $token_test_run $group_id > out
 cat out
 cat out | grep '"size": 100'
 cat out | grep '"_id": 1'
 cat out | grep '"meta_test": "test"'
 
-$Python_EXECUTABLE getnext.py 127.0.0.1:8400 tcp $source_path $beamtime_id $token_test_run $group_id> out
+$Python_EXECUTABLE getnext.py 127.0.0.1:8400 $source_path $beamtime_id $token_test_run $group_id> out
 cat out
 cat out | grep '"_id": 2'
 
diff --git a/examples/consumer/getnext_broker_python/check_windows.bat b/examples/consumer/getnext_broker_python/check_windows.bat
index dfdb7ae17..7562b1734 100644
--- a/examples/consumer/getnext_broker_python/check_windows.bat
+++ b/examples/consumer/getnext_broker_python/check_windows.bat
@@ -16,22 +16,22 @@ echo db.meta.insert({"_id":0,"meta_test":"test"}) | %mongo_exe% %database_name%
 
 set PYTHONPATH=%1
 
-python3 getnext.py 127.0.0.1:8400 tcp %source_path% %beamtime_id%  %token_test_run% %group_id% > out
+python3 getnext.py 127.0.0.1:8400 %source_path% %beamtime_id%  %token_test_run% %group_id% > out
 type out
 type out | findstr /c:"100" || goto :error
 type out | findstr /c:"\"_id\": 1" || goto :error
 type out | findstr /c:"\"meta_test\": \"test\"" || goto :error
 
-python3 getnext.py 127.0.0.1:8400 tcp %source_path% %beamtime_id%  %token_test_run% %group_id% > out
+python3 getnext.py 127.0.0.1:8400 %source_path% %beamtime_id%  %token_test_run% %group_id% > out
 type out
 type out | findstr /c:"\"_id\": 2" || goto :error
 
-python3 getnext.py 127.0.0.1:8400 tcp %source_path% %beamtime_id%  %token_test_run% %group_id% > out
+python3 getnext.py 127.0.0.1:8400 %source_path% %beamtime_id%  %token_test_run% %group_id% > out
 type out
 type out | findstr /c:"\"_id\": 3" || goto :error
 
 
-python3 getnext.py 127.0.0.1:8400 tcp %source_path% %beamtime_id%  %token_test_run% new > out
+python3 getnext.py 127.0.0.1:8400 %source_path% %beamtime_id%  %token_test_run% new > out
 type out
 type out | findstr /c:"100" || goto :error
 type out | findstr /c:"\"_id\": 1" || goto :error
diff --git a/examples/consumer/getnext_broker_python/getnext.py b/examples/consumer/getnext_broker_python/getnext.py
index 3979bfee8..10d6517cd 100644
--- a/examples/consumer/getnext_broker_python/getnext.py
+++ b/examples/consumer/getnext_broker_python/getnext.py
@@ -4,9 +4,9 @@ import asapo_consumer
 import json
 import sys
 
-source, network_type, path, beamtime, token, group_id = sys.argv[1:]
+source, path, beamtime, token, group_id = sys.argv[1:]
 
-broker = asapo_consumer.create_server_broker(source,path,True, beamtime,"",token,60000,network_type)
+broker = asapo_consumer.create_server_broker(source,path,True, beamtime,"",token,60000)
 
 
 if group_id == "new":
diff --git a/examples/pipeline/in_to_out/check_linux.sh b/examples/pipeline/in_to_out/check_linux.sh
index 0657d34ad..6490fbadb 100644
--- a/examples/pipeline/in_to_out/check_linux.sh
+++ b/examples/pipeline/in_to_out/check_linux.sh
@@ -59,7 +59,7 @@ done
 
 sleep 1
 
-$1 127.0.0.1:8400 tcp $source_path $beamtime_id $stream_in $stream_out $token 2 1000 25000 1  > out
+$1 127.0.0.1:8400 $source_path $beamtime_id $stream_in $stream_out $token 2 1000 25000 1  > out
 cat out
 cat out | grep "Processed 3 file(s)"
 cat out | grep "Sent 3 file(s)"
@@ -70,7 +70,7 @@ cat ${receiver_folder}/file1_${stream_out} | grep hello1
 cat ${receiver_folder}/file2_${stream_out} | grep hello2
 cat ${receiver_folder}/file3_${stream_out} | grep hello3
 
-$1 127.0.0.1:8400 tcp $source_path $beamtime_id $stream_in $stream_out2 $token 2 1000 25000 0  > out2
+$1 127.0.0.1:8400 $source_path $beamtime_id $stream_in $stream_out2 $token 2 1000 25000 0  > out2
 cat out2
 test ! -f ${receiver_folder}/file1_${stream_out2}
 echo "db.data_default.find({"_id":1})" | mongo ${outdatabase_name2} | tee /dev/stderr | grep ./file1
diff --git a/examples/pipeline/in_to_out/check_windows.bat b/examples/pipeline/in_to_out/check_windows.bat
index 56ef0b8e5..9b575777b 100644
--- a/examples/pipeline/in_to_out/check_windows.bat
+++ b/examples/pipeline/in_to_out/check_windows.bat
@@ -29,7 +29,7 @@ echo hello2 > file2
 echo hello3 > file3
 
 
-"%1" 127.0.0.1:8400 tcp %source_path% %beamtime_id%  %stream_in% %stream_out% %token% 2 1000 25000 1 > out
+"%1" 127.0.0.1:8400 %source_path% %beamtime_id%  %stream_in% %stream_out% %token% 2 1000 25000 1 > out
 type out
 findstr /I /L /C:"Processed 3 file(s)" out || goto :error
 findstr /I /L /C:"Sent 3 file(s)" out || goto :error
@@ -41,7 +41,7 @@ findstr /I /L /C:"hello2" %receiver_folder%\file2_%stream_out% || goto :error
 findstr /I /L /C:"hello3" %receiver_folder%\file3_%stream_out% || goto :error
 
 
-"%1" 127.0.0.1:8400 tcp %source_path% %beamtime_id%  %stream_in% %stream_out2% %token% 2 1000 25000 0 > out2
+"%1" 127.0.0.1:8400 %source_path% %beamtime_id%  %stream_in% %stream_out2% %token% 2 1000 25000 0 > out2
 type out2
 findstr /I /L /C:"Processed 3 file(s)" out2 || goto :error
 findstr /I /L /C:"Sent 3 file(s)" out2 || goto :error
diff --git a/examples/pipeline/in_to_out/in_to_out.cpp b/examples/pipeline/in_to_out/in_to_out.cpp
index 732095104..e9e794cb6 100644
--- a/examples/pipeline/in_to_out/in_to_out.cpp
+++ b/examples/pipeline/in_to_out/in_to_out.cpp
@@ -27,7 +27,6 @@ system_clock::time_point streamout_finish;
 
 struct Args {
     std::string server;
-    std::string network_type;
     std::string file_path;
     std::string beamtime_id;
     std::string stream_in;
@@ -66,7 +65,7 @@ int ProcessError(const Error& err) {
 
 BrokerPtr CreateBrokerAndGroup(const Args& args, Error* err) {
     auto broker = asapo::DataBrokerFactory::CreateServerBroker(args.server, args.file_path, true,
-                  asapo::SourceCredentials{args.beamtime_id, "", args.stream_in, args.token}, args.network_type, err);
+                  asapo::SourceCredentials{args.beamtime_id, "", args.stream_in, args.token}, err);
     if (*err) {
         return nullptr;
     }
@@ -203,24 +202,23 @@ std::unique_ptr<asapo::Producer> CreateProducer(const Args& args) {
 int main(int argc, char* argv[]) {
     asapo::ExitAfterPrintVersionIfNeeded("GetNext Broker Example", argc, argv);
     Args args;
-    if (argc != 12) {
+    if (argc != 11) {
         std::cout << "Usage: " + std::string{argv[0]}
-                  + " <server> <network_type> <files_path> <beamtime_id> <stream_in> <stream_out> <nthreads> <token> <timeout ms>  <timeout ms producer> <transfer data>"
+                  + " <server> <files_path> <beamtime_id> <stream_in> <stream_out> <nthreads> <token> <timeout ms>  <timeout ms producer> <transfer data>"
                   <<
                   std::endl;
         exit(EXIT_FAILURE);
     }
     args.server = std::string{argv[1]};
-    args.network_type = std::string{argv[2]};
-    args.file_path = std::string{argv[3]};
-    args.beamtime_id = std::string{argv[4]};
-    args.stream_in = std::string{argv[5]};
-    args.stream_out = std::string{argv[6]};
-    args.token = std::string{argv[7]};
-    args.nthreads = atoi(argv[8]);
-    args.timeout_ms = atoi(argv[9]);
-    args.timeout_ms_producer = atoi(argv[10]);
-    args.transfer_data = atoi(argv[11]) == 1;
+    args.file_path = std::string{argv[2]};
+    args.beamtime_id = std::string{argv[3]};
+    args.stream_in = std::string{argv[4]};
+    args.stream_out = std::string{argv[5]};
+    args.token = std::string{argv[6]};
+    args.nthreads = atoi(argv[7]);
+    args.timeout_ms = atoi(argv[8]);
+    args.timeout_ms_producer = atoi(argv[9]);
+    args.transfer_data = atoi(argv[10]) == 1;
 
     auto producer = CreateProducer(args);
     files_sent = 0;
diff --git a/examples/pipeline/in_to_out_python/check_linux.sh b/examples/pipeline/in_to_out_python/check_linux.sh
index a105639bc..330f40973 100644
--- a/examples/pipeline/in_to_out_python/check_linux.sh
+++ b/examples/pipeline/in_to_out_python/check_linux.sh
@@ -64,7 +64,7 @@ sleep 1
 export PYTHONPATH=$2:$3:${PYTHONPATH}
 
 
-$1 $4 127.0.0.1:8400 tcp $source_path $beamtime_id $stream_in $stream_out $token $timeout $timeout_producer $nthreads 1  > out
+$1 $4 127.0.0.1:8400 $source_path $beamtime_id $stream_in $stream_out $token $timeout $timeout_producer $nthreads 1  > out
 cat out
 cat out | grep "Processed 3 file(s)"
 cat out | grep "Sent 3 file(s)"
diff --git a/examples/pipeline/in_to_out_python/check_windows.bat b/examples/pipeline/in_to_out_python/check_windows.bat
index 90c436447..b93a7f38c 100644
--- a/examples/pipeline/in_to_out_python/check_windows.bat
+++ b/examples/pipeline/in_to_out_python/check_windows.bat
@@ -32,7 +32,7 @@ echo hello3 > file3
 
 set PYTHONPATH=%2;%3
 
-"%1" "%4" 127.0.0.1:8400 tcp %source_path% %beamtime_id% %stream_in% %stream_out% %token% %timeout% %timeout_producer% %nthreads% 1  > out
+"%1" "%4" 127.0.0.1:8400 %source_path% %beamtime_id% %stream_in% %stream_out% %token% %timeout% %timeout_producer% %nthreads% 1  > out
 
 type out
 findstr /I /L /C:"Processed 3 file(s)" out || goto :error
diff --git a/examples/pipeline/in_to_out_python/in_to_out.py b/examples/pipeline/in_to_out_python/in_to_out.py
index d42203994..fa9c2c083 100644
--- a/examples/pipeline/in_to_out_python/in_to_out.py
+++ b/examples/pipeline/in_to_out_python/in_to_out.py
@@ -20,13 +20,13 @@ def callback(header,err):
         n_send = n_send + 1
     lock.release()
 
-source, network_type, path, beamtime,stream_in, stream_out, token, timeout_s,timeout_s_producer,nthreads, transfer_data = sys.argv[1:]
+source, path, beamtime,stream_in, stream_out, token, timeout_s,timeout_s_producer,nthreads, transfer_data = sys.argv[1:]
 timeout_s=int(timeout_s)
 timeout_s_producer=int(timeout_s_producer)
 nthreads=int(nthreads)
 transfer_data=int(transfer_data)>0
 
-broker = asapo_consumer.create_server_broker(source,path, True,beamtime,stream_in,token,timeout_s*1000,network_type)
+broker = asapo_consumer.create_server_broker(source,path, True,beamtime,stream_in,token,timeout_s*1000)
 
 producer  = asapo_producer.create_producer(source,beamtime,'auto', stream_out, token, nthreads, 600)
 
diff --git a/tests/automatic/bug_fixes/consumer_python_memleak/check_linux.sh b/tests/automatic/bug_fixes/consumer_python_memleak/check_linux.sh
index ae7b712a2..766c57341 100644
--- a/tests/automatic/bug_fixes/consumer_python_memleak/check_linux.sh
+++ b/tests/automatic/bug_fixes/consumer_python_memleak/check_linux.sh
@@ -35,7 +35,7 @@ export PYTHONPATH=$1:${PYTHONPATH}
 export Python_EXECUTABLE=$2
 
 
-$Python_EXECUTABLE memleak.py $endpoint tcp $path $beamtime_id $token &> out &
+$Python_EXECUTABLE memleak.py $endpoint $path $beamtime_id $token &> out &
 pid=`echo $!`
 
 sleep 1
diff --git a/tests/automatic/bug_fixes/consumer_python_memleak/memleak.py b/tests/automatic/bug_fixes/consumer_python_memleak/memleak.py
index 28a61f22d..2f414425c 100644
--- a/tests/automatic/bug_fixes/consumer_python_memleak/memleak.py
+++ b/tests/automatic/bug_fixes/consumer_python_memleak/memleak.py
@@ -2,10 +2,10 @@ import asapo_consumer
 import sys
 import time
 
-source, network_type, path, beamtime, token = sys.argv[1:]
+source, path, beamtime, token = sys.argv[1:]
 
 broker = asapo_consumer.create_server_broker(
-    source, path,True, beamtime, "stream", token, 1000, network_type)
+    source, path,True, beamtime, "stream", token, 1000)
 
 group_id  = broker.generate_group_id()
 print('generated group id: ', group_id)
diff --git a/tests/automatic/bug_fixes/producer_send_after_restart/check_windows.bat b/tests/automatic/bug_fixes/producer_send_after_restart/check_windows.bat
index 1f5763184..815dffc54 100644
--- a/tests/automatic/bug_fixes/producer_send_after_restart/check_windows.bat
+++ b/tests/automatic/bug_fixes/producer_send_after_restart/check_windows.bat
@@ -45,7 +45,7 @@ ping 1.0.0.0 -n 10 -w 100 > nul
 
 
 REM consumer
-"%2" %proxy_address% "%4" %receiver_folder% %beamtime_id% 2 %token% 3000 1 | findstr /c:"Processed 3 file(s)"  || goto :error
+"%2" %proxy_address% %receiver_folder% %beamtime_id% 2 %token% 3000 1 | findstr /c:"Processed 3 file(s)"  || goto :error
 
 
 goto :clean
diff --git a/tests/automatic/consumer/consumer_api/check_linux.sh b/tests/automatic/consumer/consumer_api/check_linux.sh
index dd9e5e6ce..be6442d3a 100644
--- a/tests/automatic/consumer/consumer_api/check_linux.sh
+++ b/tests/automatic/consumer/consumer_api/check_linux.sh
@@ -45,7 +45,7 @@ done
 echo hello1 > 1
 
 
-$@ 127.0.0.1:8400 tcp $beamtime_id $token_test_run single
+$@ 127.0.0.1:8400 $beamtime_id $token_test_run single
 
 #check datasets
 echo "db.dropDatabase()" | mongo ${database_name}
@@ -65,4 +65,4 @@ done
 
 echo hello1 > 1_1
 
-$@ 127.0.0.1:8400 tcp $beamtime_id $token_test_run datasets
+$@ 127.0.0.1:8400 $beamtime_id $token_test_run datasets
diff --git a/tests/automatic/consumer/consumer_api/check_windows.bat b/tests/automatic/consumer/consumer_api/check_windows.bat
index 355c3a5df..6619a5c96 100644
--- a/tests/automatic/consumer/consumer_api/check_windows.bat
+++ b/tests/automatic/consumer/consumer_api/check_windows.bat
@@ -16,7 +16,7 @@ for /l %%x in (1, 1, 5) do echo db.data_stream2.insert({"_id":%%x,"size":6,"name
 echo hello1 > 1
 
 
-%1 127.0.0.1:8400 tcp %beamtime_id% %token_test_run%  single || goto :error
+%1 127.0.0.1:8400 %beamtime_id% %token_test_run%  single || goto :error
 
 echo db.dropDatabase() | %mongo_exe% %database_name%
 
@@ -24,7 +24,7 @@ for /l %%x in (1, 1, 10) do echo db.data_default.insert({"_id":%%x,"size":3,"ima
 
 echo hello1 > 1_1
 
-%1 127.0.0.1:8400 tcp %beamtime_id% %token_test_run%  datasets || goto :error
+%1 127.0.0.1:8400 %beamtime_id% %token_test_run%  datasets || goto :error
 
 goto :clean
 
diff --git a/tests/automatic/consumer/consumer_api/consumer_api.cpp b/tests/automatic/consumer/consumer_api/consumer_api.cpp
index bbab49bd7..2cfc9d9d6 100644
--- a/tests/automatic/consumer/consumer_api/consumer_api.cpp
+++ b/tests/automatic/consumer/consumer_api/consumer_api.cpp
@@ -8,24 +8,22 @@
 
 struct Args {
     std::string server;
-    std::string network_type;
     std::string run_name;
     std::string token;
     std::string datasets;
 };
 
 Args GetArgs(int argc, char* argv[]) {
-    if (argc != 6) {
+    if (argc != 5) {
         std::cout << "Wrong number of arguments" << std::endl;
         exit(EXIT_FAILURE);
     }
     std::string server{argv[1]};
-    std::string network_type{argv[2]};
-    std::string source_name{argv[3]};
-    std::string token{argv[4]};
-    std::string datasets{argv[5]};
+    std::string source_name{argv[2]};
+    std::string token{argv[3]};
+    std::string datasets{argv[4]};
 
-    return Args{server, network_type, source_name, token, datasets};
+    return Args{server, source_name, token, datasets};
 }
 
 
@@ -211,7 +209,7 @@ void TestDataset(const std::unique_ptr<asapo::DataBroker>& broker, const std::st
 void TestAll(const Args& args) {
     asapo::Error err;
     auto broker = asapo::DataBrokerFactory::CreateServerBroker(args.server, ".", true,
-                  asapo::SourceCredentials{args.run_name, "", "", args.token}, args.network_type, &err);
+                  asapo::SourceCredentials{args.run_name, "", "", args.token}, &err);
     if (err) {
         std::cout << "Error CreateServerBroker: " << err << std::endl;
         exit(EXIT_FAILURE);
diff --git a/tests/automatic/consumer/consumer_api_python/check_linux.sh b/tests/automatic/consumer/consumer_api_python/check_linux.sh
index 9ad982107..04f3c058b 100644
--- a/tests/automatic/consumer/consumer_api_python/check_linux.sh
+++ b/tests/automatic/consumer/consumer_api_python/check_linux.sh
@@ -52,7 +52,7 @@ sleep 1
 
 export PYTHONPATH=$1:${PYTHONPATH}
 export Python_EXECUTABLE=$2
-$Python_EXECUTABLE $3/consumer_api.py 127.0.0.1:8400 tcp $source_path $beamtime_id $token_test_run single
+$Python_EXECUTABLE $3/consumer_api.py 127.0.0.1:8400 $source_path $beamtime_id $token_test_run single
 
 #check datasets
 echo "db.dropDatabase()" | mongo ${database_name} > /dev/null
@@ -71,4 +71,4 @@ do
 done
 
 
-$Python_EXECUTABLE $3/consumer_api.py 127.0.0.1:8400 tcp $source_path $beamtime_id $token_test_run datasets
+$Python_EXECUTABLE $3/consumer_api.py 127.0.0.1:8400 $source_path $beamtime_id $token_test_run datasets
diff --git a/tests/automatic/consumer/consumer_api_python/check_windows.bat b/tests/automatic/consumer/consumer_api_python/check_windows.bat
index 4e9b1fa1e..1b0ade3d5 100644
--- a/tests/automatic/consumer/consumer_api_python/check_windows.bat
+++ b/tests/automatic/consumer/consumer_api_python/check_windows.bat
@@ -27,13 +27,13 @@ set PYTHONPATH=%1
 echo | set /p dummyName="hello1" > %source_path%\1
 echo | set /p dummyName="hello1" > %source_path%\1_1
 
-python %3/consumer_api.py 127.0.0.1:8400 tcp %source_path% %beamtime_id%  %token_test_run%  single || goto :error
+python %3/consumer_api.py 127.0.0.1:8400 %source_path% %beamtime_id%  %token_test_run%  single || goto :error
 
 echo db.dropDatabase() | %mongo_exe% %database_name%
 
 for /l %%x in (1, 1, 10) do echo db.data_default.insert({"_id":%%x,"size":3,"images":[{"_id":1, "size":6,"name":"%%x_1","lastchange":1,"source":"none","buf_id":0,"meta":{"test":10}},{"_id":2, "size":6,"name":"%%x_2","lastchange":1,"source":"none","buf_id":0,"meta":{"test":10}},{"_id":3, "size":6,"name":"%%x_3","lastchange":1,"source":"none","buf_id":0,"meta":{"test":10}}]}) | %mongo_exe% %database_name%  || goto :error
 
-python %3/consumer_api.py 127.0.0.1:8400 tcp %source_path% %beamtime_id%  %token_test_run% datasets || goto :error
+python %3/consumer_api.py 127.0.0.1:8400 %source_path% %beamtime_id%  %token_test_run% datasets || goto :error
 
 
 goto :clean
diff --git a/tests/automatic/consumer/consumer_api_python/consumer_api.py b/tests/automatic/consumer/consumer_api_python/consumer_api.py
index 74eef9963..32f9d2c29 100644
--- a/tests/automatic/consumer/consumer_api_python/consumer_api.py
+++ b/tests/automatic/consumer/consumer_api_python/consumer_api.py
@@ -175,7 +175,7 @@ def check_single(broker,group_id):
     else:
         exit_on_noerr("wrong query")
 
-    broker = asapo_consumer.create_server_broker("bla",path, True, beamtime,"",token,1000,network_type)
+    broker = asapo_consumer.create_server_broker("bla",path, True, beamtime,"",token,1000)
     try:
         broker.get_last(group_id, meta_only=True)
     except asapo_consumer.AsapoUnavailableServiceError as err:
@@ -224,13 +224,14 @@ def check_dataset(broker,group_id):
     else:
         exit_on_noerr("get_next_dataset4 err")
 
-source, network_type, path, beamtime, token, mode = sys.argv[1:]
+source, path, beamtime, token, mode = sys.argv[1:]
 
-broker = asapo_consumer.create_server_broker(source,path,True, beamtime,"",token,60000,network_type)
-broker_fts = asapo_consumer.create_server_broker(source,path,False, beamtime,"",token,60000,network_type)
+broker = asapo_consumer.create_server_broker(source, path, True, beamtime, "", token, 60000)
+broker_fts = asapo_consumer.create_server_broker(source, path, False, beamtime, "", token, 60000)
 
 group_id = broker.generate_group_id()
 
+
 group_id_fts = broker_fts.generate_group_id()
 
 if mode == "single":
diff --git a/tests/automatic/consumer/next_multithread_broker/check_linux.sh b/tests/automatic/consumer/next_multithread_broker/check_linux.sh
index bb15a380e..b4a6c53c9 100644
--- a/tests/automatic/consumer/next_multithread_broker/check_linux.sh
+++ b/tests/automatic/consumer/next_multithread_broker/check_linux.sh
@@ -28,6 +28,6 @@ do
 	echo 'db.data_default.insert({"_id":'$i',"size":100,"name":"'$i'","lastchange":1,"source":"none","buf_id":0,"meta":{"test":10}})' | mongo ${database_name}
 done
 
-$@ 127.0.0.1:8400 tcp test_run 4 10 $token_test_run
+$@ 127.0.0.1:8400 test_run 4 10 $token_test_run
 
 
diff --git a/tests/automatic/consumer/next_multithread_broker/check_windows.bat b/tests/automatic/consumer/next_multithread_broker/check_windows.bat
index 275660dd2..4c4bb2e68 100644
--- a/tests/automatic/consumer/next_multithread_broker/check_windows.bat
+++ b/tests/automatic/consumer/next_multithread_broker/check_windows.bat
@@ -7,7 +7,7 @@ call start_services.bat
 for /l %%x in (1, 1, 10) do echo db.data_default.insert({"_id":%%x,"size":100,"name":"%%x","lastchange":1,"source":"none","buf_id":0,"meta":{"test":10}}) | %mongo_exe% %database_name%  || goto :error
 
 
-%1 127.0.0.1:8400 tcp test_run 4 10 %token_test_run% || goto :error
+%1 127.0.0.1:8400 test_run 4 10 %token_test_run% || goto :error
 
 goto :clean
 
diff --git a/tests/automatic/consumer/next_multithread_broker/next_multithread_broker.cpp b/tests/automatic/consumer/next_multithread_broker/next_multithread_broker.cpp
index af8e72430..33ff6eccc 100644
--- a/tests/automatic/consumer/next_multithread_broker/next_multithread_broker.cpp
+++ b/tests/automatic/consumer/next_multithread_broker/next_multithread_broker.cpp
@@ -31,7 +31,6 @@ void Assert(std::vector<asapo::FileInfos> file_infos, int nthreads, int nfiles)
 
 struct Args {
     std::string server;
-    std::string network_type;
     std::string run_name;
     std::string token;
     int nthreads;
@@ -39,24 +38,22 @@ struct Args {
 };
 
 Args GetArgs(int argc, char* argv[]) {
-    if (argc != 7) {
+    if (argc != 6) {
         std::cout << "Wrong number of arguments" << std::endl;
         exit(EXIT_FAILURE);
     }
     std::string server{argv[1]};
-    std::string network_type{argv[2]};
-    std::string source_name{argv[3]};
-    int nthreads = std::stoi(argv[4]);
-    int nfiles = std::stoi(argv[5]);
-    std::string token{argv[6]};
+    std::string source_name{argv[2]};
+    int nthreads = std::stoi(argv[3]);
+    int nfiles = std::stoi(argv[4]);
+    std::string token{argv[5]};
 
-    return Args{server, network_type, source_name, token, nthreads, nfiles};
+    return Args{server, source_name, token, nthreads, nfiles};
 }
 
 void TestAll(const Args& args) {
     asapo::Error err;
-    auto broker = asapo::DataBrokerFactory::CreateServerBroker(args.server, "dummy", true, asapo::SourceCredentials{args.run_name, "", "", args.token},
-                  args.network_type, &err);
+    auto broker = asapo::DataBrokerFactory::CreateServerBroker(args.server, "dummy", true, asapo::SourceCredentials{args.run_name, "", "", args.token}, &err);
     if (err) {
         std::cout << "Error CreateServerBroker: " << err << std::endl;
         exit(EXIT_FAILURE);
diff --git a/tests/automatic/curl_http_client/curl_http_client_command/check_linux.sh b/tests/automatic/curl_http_client/curl_http_client_command/check_linux.sh
index b42023c8a..406b111aa 100644
--- a/tests/automatic/curl_http_client/curl_http_client_command/check_linux.sh
+++ b/tests/automatic/curl_http_client/curl_http_client_command/check_linux.sh
@@ -23,7 +23,7 @@ echo -n hello > $file_transfer_folder/aaa
 
 dd if=/dev/urandom of=$file_transfer_folder/random bs=1 count=100000
 
-$1  127.0.0.1:5007 tcp 127.0.0.1:5008 $file_transfer_folder
+$1  127.0.0.1:5007 127.0.0.1:5008 $file_transfer_folder
 cat bbb | tee /dev/stderr | grep hello
 diff -q random $file_transfer_folder/random
 
diff --git a/tests/automatic/curl_http_client/curl_http_client_command/check_windows.bat b/tests/automatic/curl_http_client/curl_http_client_command/check_windows.bat
index bee5675e2..7aab2755c 100644
--- a/tests/automatic/curl_http_client/curl_http_client_command/check_windows.bat
+++ b/tests/automatic/curl_http_client/curl_http_client_command/check_windows.bat
@@ -15,7 +15,7 @@ echo | set /p dummyName="hello" > %file_transfer_folder%\aaa
 
 python3 -c "import os;fout=open('%file_transfer_folder%\\random', 'wb');fout.write(os.urandom(100000))"
 
-"%1"  127.0.0.1:5007 tcp 127.0.0.1:5008 %file_transfer_folder%   || goto :error
+"%1"  127.0.0.1:5007 127.0.0.1:5008 %file_transfer_folder%   || goto :error
 
 type bbb | findstr /c:"hello"  || goto :error
 
diff --git a/tests/automatic/curl_http_client/curl_http_client_command/curl_httpclient_command.cpp b/tests/automatic/curl_http_client/curl_http_client_command/curl_httpclient_command.cpp
index 831e0a623..45527f88e 100644
--- a/tests/automatic/curl_http_client/curl_http_client_command/curl_httpclient_command.cpp
+++ b/tests/automatic/curl_http_client/curl_http_client_command/curl_httpclient_command.cpp
@@ -9,21 +9,19 @@
 
 struct Args {
     std::string uri_authorizer;
-    std::string network_type;
     std::string uri_fts;
     std::string folder;
 };
 
 Args GetArgs(int argc, char* argv[]) {
-    if (argc != 5) {
+    if (argc != 4) {
         std::cout << "Wrong number of arguments" << std::endl;
         exit(EXIT_FAILURE);
     }
     std::string uri_authorizer{argv[1]};
-    std::string network_type{argv[2]};
-    std::string uri_fts{argv[3]};
-    std::string folder{argv[4]};
-    return Args{uri_authorizer, network_type, uri_fts, folder};
+    std::string uri_fts{argv[2]};
+    std::string folder{argv[3]};
+    return Args{uri_authorizer, uri_fts, folder};
 }
 
 
@@ -34,8 +32,7 @@ int main(int argc, char* argv[]) {
     std::string authorize_request = "{\"Folder\":\"" + args.folder + "\",\"BeamtimeId\":\"aaa\",\"Token\":\"" + token +
                                     "\"}";
     asapo::Error err;
-    auto broker = asapo::DataBrokerFactory::CreateServerBroker(args.uri_authorizer, "", true, asapo::SourceCredentials{"", "", "", ""},
-                  args.network_type, &err);
+    auto broker = asapo::DataBrokerFactory::CreateServerBroker(args.uri_authorizer, "", true, asapo::SourceCredentials{"", "", "", ""}, &err);
     auto server_broker = static_cast<asapo::ServerDataBroker*>(broker.get());
     M_AssertEq(nullptr, err);
 
diff --git a/tests/automatic/full_chain/send_recv_substreams/check_linux.sh b/tests/automatic/full_chain/send_recv_substreams/check_linux.sh
index 11acb1162..f7f1f0241 100644
--- a/tests/automatic/full_chain/send_recv_substreams/check_linux.sh
+++ b/tests/automatic/full_chain/send_recv_substreams/check_linux.sh
@@ -29,9 +29,9 @@ Cleanup() {
 nomad run nginx.nmd
 nomad run discovery.nmd
 nomad run broker.nmd
-nomad run receiver_${network_type}.nmd
+nomad run receiver_tcp.nmd
 nomad run authorizer.nmd
 
 
-$1 127.0.0.1:8400 $network_type $beamtime_id $token > out
-cat out
+$1 127.0.0.1:8400 $beamtime_id $token | tee out
+
diff --git a/tests/automatic/full_chain/send_recv_substreams/check_windows.bat b/tests/automatic/full_chain/send_recv_substreams/check_windows.bat
index aa3d9d960..d89ca68c8 100644
--- a/tests/automatic/full_chain/send_recv_substreams/check_windows.bat
+++ b/tests/automatic/full_chain/send_recv_substreams/check_windows.bat
@@ -12,7 +12,7 @@ SET mongo_exe="c:\Program Files\MongoDB\Server\4.2\bin\mongo.exe"
 
 call start_services.bat
 
-"%1" 127.0.0.1:8400 "%2" %beamtime_id% %token%
+"%1" 127.0.0.1:8400 %beamtime_id% %token%
 
 goto :clean
 
diff --git a/tests/automatic/full_chain/send_recv_substreams/send_recv_substreams.cpp b/tests/automatic/full_chain/send_recv_substreams/send_recv_substreams.cpp
index 514a4de6d..0a4a0b910 100644
--- a/tests/automatic/full_chain/send_recv_substreams/send_recv_substreams.cpp
+++ b/tests/automatic/full_chain/send_recv_substreams/send_recv_substreams.cpp
@@ -18,11 +18,10 @@ using BrokerPtr = std::unique_ptr<asapo::DataBroker>;
 using ProducerPtr = std::unique_ptr<asapo::Producer>;
 std::string group_id = "";
 
-int files_sent;
+uint64_t files_sent;
 
 struct Args {
     std::string server;
-    std::string network_type;
     std::string beamtime_id;
     std::string token;
 };
@@ -37,7 +36,7 @@ void ProcessAfterSend(asapo::RequestCallbackPayload payload, asapo::Error err) {
 
 BrokerPtr CreateBrokerAndGroup(const Args& args, Error* err) {
     auto broker = asapo::DataBrokerFactory::CreateServerBroker(args.server, ".", true,
-                  asapo::SourceCredentials{args.beamtime_id, "", "", args.token}, args.network_type, err);
+                  asapo::SourceCredentials{args.beamtime_id, "", "", args.token}, err);
     if (*err) {
         return nullptr;
     }
@@ -79,12 +78,11 @@ int main(int argc, char* argv[]) {
         exit(EXIT_FAILURE);
     }
     args.server = std::string{argv[1]};
-    args.network_type = std::string{argv[2]};
-    args.beamtime_id = std::string{argv[3]};
-    args.token = std::string{argv[4]};
+    args.beamtime_id = std::string{argv[2]};
+    args.token = std::string{argv[3]};
     auto producer = CreateProducer(args);
 
-    auto n = 1;
+    uint64_t n = 1;
 
     for (uint64_t i = 0; i < n; i++) {
         asapo::EventHeader event_header{i + 1, 0, std::to_string(i + 1)};
diff --git a/tests/automatic/full_chain/send_recv_substreams_python/CMakeLists.txt b/tests/automatic/full_chain/send_recv_substreams_python/CMakeLists.txt
index 10a9c04a6..26c975030 100644
--- a/tests/automatic/full_chain/send_recv_substreams_python/CMakeLists.txt
+++ b/tests/automatic/full_chain/send_recv_substreams_python/CMakeLists.txt
@@ -11,4 +11,4 @@ endif()
 
 file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/send_recv_substreams.py TEST_SCRIPT )
 
-add_script_test("${TARGET_NAME}-tcp" "${Python_EXECUTABLE} ${PYTHON_LIBS_CONSUMER} ${PYTHON_LIBS_PRODUCER} ${TEST_SCRIPT} tcp" nomem)
+add_script_test("${TARGET_NAME}" "${Python_EXECUTABLE} ${PYTHON_LIBS_CONSUMER} ${PYTHON_LIBS_PRODUCER} ${TEST_SCRIPT}" nomem)
diff --git a/tests/automatic/full_chain/send_recv_substreams_python/check_linux.sh b/tests/automatic/full_chain/send_recv_substreams_python/check_linux.sh
index d33ffb364..024acde68 100644
--- a/tests/automatic/full_chain/send_recv_substreams_python/check_linux.sh
+++ b/tests/automatic/full_chain/send_recv_substreams_python/check_linux.sh
@@ -13,8 +13,6 @@ set -e
 
 trap Cleanup EXIT
 
-network_type=$5
-
 Cleanup() {
     set +e
     nomad stop nginx
@@ -29,11 +27,11 @@ Cleanup() {
 nomad run nginx.nmd
 nomad run discovery.nmd
 nomad run broker.nmd
-nomad run receiver_${network_type}.nmd
+nomad run receiver_tcp.nmd
 nomad run authorizer.nmd
 
 
 export PYTHONPATH=$2:$3:${PYTHONPATH}
 
 
-$1 $4 127.0.0.1:8400 $network_type $beamtime_id $token
+$1 $4 127.0.0.1:8400 $beamtime_id $token | tee out
diff --git a/tests/automatic/full_chain/send_recv_substreams_python/check_windows.bat b/tests/automatic/full_chain/send_recv_substreams_python/check_windows.bat
index 35313f6ba..475943c37 100644
--- a/tests/automatic/full_chain/send_recv_substreams_python/check_windows.bat
+++ b/tests/automatic/full_chain/send_recv_substreams_python/check_windows.bat
@@ -12,7 +12,7 @@ SET mongo_exe="c:\Program Files\MongoDB\Server\4.2\bin\mongo.exe"
 
 call start_services.bat
 
-"%1" 127.0.0.1:8400 "%5" %beamtime_id% %token%
+"%1" 127.0.0.1:8400 %beamtime_id% %token%
 
 goto :clean
 
diff --git a/tests/automatic/full_chain/send_recv_substreams_python/send_recv_substreams.py b/tests/automatic/full_chain/send_recv_substreams_python/send_recv_substreams.py
index 5e32c3476..c35fb9c0b 100644
--- a/tests/automatic/full_chain/send_recv_substreams_python/send_recv_substreams.py
+++ b/tests/automatic/full_chain/send_recv_substreams_python/send_recv_substreams.py
@@ -23,9 +23,9 @@ def callback(header,err):
         print ("successfuly sent: ",header)
     lock.release()
 
-source, network_type, beamtime, token = sys.argv[1:]
+source, beamtime, token = sys.argv[1:]
 
-broker = asapo_consumer.create_server_broker(source,".",True, beamtime,"",token,timeout,network_type)
+broker = asapo_consumer.create_server_broker(source,".",True, beamtime,"",token,timeout)
 producer  = asapo_producer.create_producer(source,beamtime,'auto', "", token, 1, 600)
 producer.set_log_level("debug")
 
@@ -54,6 +54,6 @@ while True:
 
 assert_eq(n_recv, n_send, "send=recv")
 assert_eq(substream_finished, True, "substream finished")
-print ('Network mode:', broker.current_connection_type())
+print('Using connection type: ' + broker.current_connection_type())
 
 
diff --git a/tests/automatic/full_chain/simple_chain/CMakeLists.txt b/tests/automatic/full_chain/simple_chain/CMakeLists.txt
index ddb11f8a8..1f7374efe 100644
--- a/tests/automatic/full_chain/simple_chain/CMakeLists.txt
+++ b/tests/automatic/full_chain/simple_chain/CMakeLists.txt
@@ -4,8 +4,4 @@ set(TARGET_NAME full_chain_simple_chain)
 # Testing
 ################################
 prepare_asapo()
-add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME> tcp" nomem)
-
-if (ENABLE_LIBFABRIC)
-    add_script_test("${TARGET_NAME}-fabric" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME> fabric" nomem)
-endif()
+add_script_test("${TARGET_NAME}" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME>" nomem)
diff --git a/tests/automatic/full_chain/simple_chain/check_linux.sh b/tests/automatic/full_chain/simple_chain/check_linux.sh
index c0aecc7eb..fcc4a10f0 100755
--- a/tests/automatic/full_chain/simple_chain/check_linux.sh
+++ b/tests/automatic/full_chain/simple_chain/check_linux.sh
@@ -7,7 +7,6 @@ trap Cleanup EXIT
 producer_bin=$1
 consumer_bin=$2
 asapo_tool_bin=$3
-network_type=$4
 
 beamtime_id=asapo_test
 token=`$asapo_tool_bin token -secret auth_secret.key $beamtime_id`
@@ -44,7 +43,7 @@ echo "db.dropDatabase()" | mongo ${beamtime_id}_detector
 
 nomad run nginx.nmd
 nomad run authorizer.nmd
-nomad run receiver_${network_type}.nmd
+nomad run receiver_tcp.nmd # Only use TCP because the consumer will only use metadata anyways
 nomad run discovery.nmd
 nomad run broker.nmd
 
@@ -55,7 +54,7 @@ mkdir -p ${receiver_folder}
 $producer_bin localhost:8400 ${beamtime_id} 100 1000 4 0 100
 #producerid=`echo $!`
 
-echo "Start consumer in $network_type mode"
-$consumer_bin ${proxy_address} $network_type ${receiver_folder} ${beamtime_id} 2 $token 5000 1 | tee out
-cat out
-cat out | grep "Processed 1000 file(s)"
+echo "Start consumer in metadata only mode"
+$consumer_bin ${proxy_address} ${receiver_folder} ${beamtime_id} 2 $token 5000 1 | tee out
+grep "Processed 1000 file(s)" out
+grep -i "Using connection type: No connection" out
diff --git a/tests/automatic/full_chain/simple_chain/check_windows.bat b/tests/automatic/full_chain/simple_chain/check_windows.bat
index 8a131a4da..7b2024362 100644
--- a/tests/automatic/full_chain/simple_chain/check_windows.bat
+++ b/tests/automatic/full_chain/simple_chain/check_windows.bat
@@ -21,7 +21,7 @@ start /B "" "%1" %proxy_address% %beamtime_id% 100 1000 4 0 100
 ping 1.0.0.0 -n 1 -w 100 > nul
 
 REM consumer
-"%2" %proxy_address% "%4" %receiver_folder% %beamtime_id% 2 %token% 5000  1 > out.txt
+"%2" %proxy_address% %receiver_folder% %beamtime_id% 2 %token% 5000 1 > out.txt
 type out.txt
 findstr /i /l /c:"Processed 1000 file(s)"  out.txt || goto :error
 
diff --git a/tests/automatic/full_chain/simple_chain_dataset/check_linux.sh b/tests/automatic/full_chain/simple_chain_dataset/check_linux.sh
index ef78b0f41..6972a6ef1 100644
--- a/tests/automatic/full_chain/simple_chain_dataset/check_linux.sh
+++ b/tests/automatic/full_chain/simple_chain_dataset/check_linux.sh
@@ -50,8 +50,9 @@ echo "Start producer"
 mkdir -p ${receiver_folder}
 $producer_bin localhost:8400 ${beamtime_id} 100 100 4 0 100 5 &
 
-echo "Start consumer in $network_type mode"
-$consumer_bin ${proxy_address} $network_type ${receiver_folder} ${beamtime_id} 2 $token 5000 1 1 | tee out
-cat out   | grep "Processed 100 dataset(s)"
-cat out   | grep "with 500 file(s)"
+echo "Start consumer in metadata only mode"
+$consumer_bin ${proxy_address} ${receiver_folder} ${beamtime_id} 2 $token 5000 1 1 | tee out
+grep "Processed 100 dataset(s)" out
+grep "with 500 file(s)" out
+grep -i "Using connection type: No connection" out
 
diff --git a/tests/automatic/full_chain/simple_chain_dataset/check_windows.bat b/tests/automatic/full_chain/simple_chain_dataset/check_windows.bat
index ec20845c9..e1273b939 100644
--- a/tests/automatic/full_chain/simple_chain_dataset/check_windows.bat
+++ b/tests/automatic/full_chain/simple_chain_dataset/check_windows.bat
@@ -20,7 +20,7 @@ start /B "" "%1" %proxy_address% %beamtime_id% 100 100 4 0 100 5
 ping 1.0.0.0 -n 1 -w 100 > nul
 
 REM consumer
-"%2" %proxy_address% "%4" %receiver_folder% %beamtime_id% 2 %token% 5000 1 1 > out.txt
+"%2" %proxy_address% %receiver_folder% %beamtime_id% 2 %token% 5000 1 1 > out.txt
 type out.txt
 findstr /i /l /c:"Processed 100 dataset(s)"  out.txt || goto :error
 findstr /i /l /c:"with 500 file(s)"  out.txt || goto :error
diff --git a/tests/automatic/full_chain/simple_chain_filegen/check_linux.sh b/tests/automatic/full_chain/simple_chain_filegen/check_linux.sh
index 8f1f34581..4e88475f4 100644
--- a/tests/automatic/full_chain/simple_chain_filegen/check_linux.sh
+++ b/tests/automatic/full_chain/simple_chain_filegen/check_linux.sh
@@ -60,8 +60,10 @@ echo hello > /tmp/asapo/test_in/test1/file1
 echo hello > /tmp/asapo/test_in/test1/file2
 echo hello > /tmp/asapo/test_in/test2/file2
 
-echo "Start consumer in $network_type mode"
-$consumer_bin ${proxy_address} $network_type ${receiver_folder} ${beamtime_id} 2 $token 1000 1 | tee /dev/stderr | grep "Processed 3 file(s)"
+echo "Start consumer in metadata only mode"
+$consumer_bin ${proxy_address} ${receiver_folder} ${beamtime_id} 2 $token 1000 1 | tee /dev/stderr out
+grep "Processed 3 file(s)" out
+grep -i "Using connection type: No connection" out
 
 test ! -f /tmp/asapo/test_in/test1/file1
 test ! -f /tmp/asapo/test_in/test1/file2
diff --git a/tests/automatic/full_chain/simple_chain_filegen/check_windows.bat b/tests/automatic/full_chain/simple_chain_filegen/check_windows.bat
index 2db77cfb9..500e19ccd 100644
--- a/tests/automatic/full_chain/simple_chain_filegen/check_windows.bat
+++ b/tests/automatic/full_chain/simple_chain_filegen/check_windows.bat
@@ -34,7 +34,7 @@ ping 1.0.0.0 -n 10 -w 100 > nul
 
 
 REM consumer
-"%2" %proxy_address% "%4" %receiver_folder% %beamtime_id% 2 %token% 1000  1 > out.txt
+"%2" %proxy_address% %receiver_folder% %beamtime_id% 2 %token% 1000  1 > out.txt
 type out.txt
 findstr /i /l /c:"Processed 3 file(s)"  out.txt || goto :error
 
diff --git a/tests/automatic/full_chain/simple_chain_filegen_batches/check_linux.sh b/tests/automatic/full_chain/simple_chain_filegen_batches/check_linux.sh
index e745aaabc..a9a31bb2e 100644
--- a/tests/automatic/full_chain/simple_chain_filegen_batches/check_linux.sh
+++ b/tests/automatic/full_chain/simple_chain_filegen_batches/check_linux.sh
@@ -44,7 +44,7 @@ echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detec
 
 nomad run nginx.nmd
 nomad run authorizer.nmd
-nomad run receiver_${network_type}.nmd
+nomad run receiver_tcp.nmd
 nomad run discovery.nmd
 nomad run broker.nmd
 
@@ -61,10 +61,11 @@ echo hello > /tmp/asapo/test_in/test1/file1
 echo hello > /tmp/asapo/test_in/test1/file2
 echo hello > /tmp/asapo/test_in/test2/file2
 
-echo "Start consumer in $network_type mode"
-$consumer_bin ${proxy_address} $network_type ${receiver_folder} ${beamtime_id} 2 $token 2000 1 1 | tee out
-cat out   | grep "Processed 1 dataset(s)"
-cat out   | grep "with 3 file(s)"
+echo "Start consumer in metadata only mode"
+$consumer_bin ${proxy_address} ${receiver_folder} ${beamtime_id} 2 $token 2000 1 1 | tee out
+grep "Processed 1 dataset(s)" out
+grep "with 3 file(s)" out
+grep -i "Using connection type: No connection" out
 
 test -f /tmp/asapo/test_in/test1/file1
 test -f /tmp/asapo/test_in/test1/file2
diff --git a/tests/automatic/full_chain/simple_chain_filegen_batches/check_windows.bat b/tests/automatic/full_chain/simple_chain_filegen_batches/check_windows.bat
index 5a17e1393..5c5e7017f 100644
--- a/tests/automatic/full_chain/simple_chain_filegen_batches/check_windows.bat
+++ b/tests/automatic/full_chain/simple_chain_filegen_batches/check_windows.bat
@@ -34,7 +34,7 @@ ping 1.0.0.0 -n 10 -w 100 > nul
 
 
 REM consumer
-"%2" %proxy_address% "%4" %receiver_folder% %beamtime_id% 2 %token% 1000 1 1 > out.txt
+"%2" %proxy_address% %receiver_folder% %beamtime_id% 2 %token% 1000 1 1 > out.txt
 type out.txt
 findstr /i /l /c:"Processed 1 dataset(s)"  out.txt || goto :error
 findstr /i /l /c:"with 3 file(s)"  out.txt || goto :error
diff --git a/tests/automatic/full_chain/simple_chain_filegen_multisource/CMakeLists.txt b/tests/automatic/full_chain/simple_chain_filegen_multisource/CMakeLists.txt
index bd3159a78..16d6a270f 100644
--- a/tests/automatic/full_chain/simple_chain_filegen_multisource/CMakeLists.txt
+++ b/tests/automatic/full_chain/simple_chain_filegen_multisource/CMakeLists.txt
@@ -15,4 +15,4 @@ configure_file(test.json.in test1.json @ONLY)
 SET (ID 2)
 configure_file(test.json.in test2.json @ONLY)
 
-add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:event-monitor-producer-bin> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME> tcp" nomem)
+add_script_test("${TARGET_NAME}" "$<TARGET_FILE:event-monitor-producer-bin> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME>" nomem)
diff --git a/tests/automatic/full_chain/simple_chain_filegen_multisource/check_linux.sh b/tests/automatic/full_chain/simple_chain_filegen_multisource/check_linux.sh
index 526aba56a..bcdbfa2c3 100644
--- a/tests/automatic/full_chain/simple_chain_filegen_multisource/check_linux.sh
+++ b/tests/automatic/full_chain/simple_chain_filegen_multisource/check_linux.sh
@@ -7,7 +7,6 @@ trap Cleanup EXIT
 producer_bin=$1
 consumer_bin=$2
 asapo_tool_bin=$3
-network_type=$4
 
 beamtime_id=asapo_test
 token=`$asapo_tool_bin token -secret auth_secret.key $beamtime_id`
@@ -45,7 +44,7 @@ echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detec
 
 nomad run nginx.nmd
 nomad run authorizer.nmd
-nomad run receiver_${network_type}.nmd
+nomad run receiver_tcp.nmd
 nomad run discovery.nmd
 nomad run broker.nmd
 
@@ -68,7 +67,8 @@ echo hello > /tmp/asapo/test_in/test1/file2
 echo hello > /tmp/asapo/test_in/test2/file1
 echo hello > /tmp/asapo/test_in/test2/file2
 
-echo "Start consumer in $network_type mode"
+echo "Start consumer in metadata only mode"
 $consumer_bin ${proxy_address} $network_type ${receiver_folder} ${beamtime_id} 2 $token 2000 1 1 | tee out
-cat out   | grep "Processed 2 dataset(s)"
-cat out   | grep "with 4 file(s)"
+grep "Processed 2 dataset(s)" out
+grep "with 4 file(s)" out
+grep -i "Using connection type: No connection" out
diff --git a/tests/automatic/full_chain/simple_chain_filegen_multisource/check_windows.bat b/tests/automatic/full_chain/simple_chain_filegen_multisource/check_windows.bat
index 918ebbef3..edb87126c 100644
--- a/tests/automatic/full_chain/simple_chain_filegen_multisource/check_windows.bat
+++ b/tests/automatic/full_chain/simple_chain_filegen_multisource/check_windows.bat
@@ -40,10 +40,11 @@ ping 1.0.0.0 -n 10 -w 100 > nul
 
 
 REM consumer
-"%2" %proxy_address% "%4" %receiver_folder% %beamtime_id% 2 %token% 1000 1 1 > out.txt
+"%2" %proxy_address% %receiver_folder% %beamtime_id% 2 %token% 1000 1 1 > out.txt
 type out.txt
-findstr /i /l /c:"Processed 2 dataset(s)"  out.txt || goto :error
-findstr /i /l /c:"with 4 file(s)"  out.txt || goto :error
+findstr /i /l /c:"Processed 2 dataset(s)" out.txt || goto :error
+findstr /i /l /c:"with 4 file(s)" out.txt || goto :error
+findstr /i /l /c:"Using connection type: No connection" out.txt || goto :error
 
 goto :clean
 
@@ -60,5 +61,3 @@ Taskkill /IM "%producer_short_name%" /F
 
 del /f token
 echo db.dropDatabase() | %mongo_exe% %beamtime_id%_detector
-
-
diff --git a/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/check_linux.sh b/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/check_linux.sh
index 69665166a..05b1e16e1 100644
--- a/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/check_linux.sh
+++ b/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/check_linux.sh
@@ -63,7 +63,7 @@ echo -n hello2 > /tmp/asapo/test_in/test1/file2
 echo -n hello3 > /tmp/asapo/test_in/test2/file2
 
 echo "Start consumer in $network_type mode"
-$consumer_bin ${proxy_address} $network_type ${receiver_folder} ${beamtime_id} 2 $token 1000 0 | tee out.txt
+$consumer_bin ${proxy_address} ${receiver_folder} ${beamtime_id} 2 $token 1000 0 | tee out.txt
 grep "Processed 3 file(s)" out.txt
 grep "hello1" out.txt
 grep "hello2" out.txt
diff --git a/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/check_windows.bat b/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/check_windows.bat
index d83c34511..dc674898e 100644
--- a/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/check_windows.bat
+++ b/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/check_windows.bat
@@ -34,7 +34,7 @@ ping 1.0.0.0 -n 10 -w 100 > nul
 
 
 REM consumer
-"%2" %proxy_address% "%4" %receiver_folder% %beamtime_id% 2 %token% 1000 0 > out.txt
+"%2" %proxy_address% %receiver_folder% %beamtime_id% 2 %token% 1000 0 > out.txt
 type out.txt
 findstr /i /l /c:"Processed 3 file(s)" out.txt || goto :error
 findstr /i /l /c:"hello1" out.txt || goto :error
diff --git a/tests/automatic/full_chain/simple_chain_filegen_readdata_file/check_linux.sh b/tests/automatic/full_chain/simple_chain_filegen_readdata_file/check_linux.sh
index 0212ef329..8b65535b5 100644
--- a/tests/automatic/full_chain/simple_chain_filegen_readdata_file/check_linux.sh
+++ b/tests/automatic/full_chain/simple_chain_filegen_readdata_file/check_linux.sh
@@ -62,9 +62,10 @@ echo -n hello2 > /tmp/asapo/test_in/test1/file2
 echo -n hello3 > /tmp/asapo/test_in/test2/file2
 
 echo "Start consumer in $network_type mode"
-$consumer_bin ${proxy_address} $network_type ${receiver_folder} ${beamtime_id} 2 $token 1000 0 | tee out.txt
+$consumer_bin ${proxy_address} ${receiver_folder} ${beamtime_id} 2 $token 1000 0 | tee out.txt
 grep "Processed 3 file(s)" out.txt
 grep "hello1" out.txt
 grep "hello2" out.txt
 grep "hello3" out.txt
+grep -i "Using connection type: No connection" out.txt
 
diff --git a/tests/automatic/full_chain/simple_chain_filegen_readdata_file/check_windows.bat b/tests/automatic/full_chain/simple_chain_filegen_readdata_file/check_windows.bat
index d83c34511..68347e567 100644
--- a/tests/automatic/full_chain/simple_chain_filegen_readdata_file/check_windows.bat
+++ b/tests/automatic/full_chain/simple_chain_filegen_readdata_file/check_windows.bat
@@ -34,12 +34,13 @@ ping 1.0.0.0 -n 10 -w 100 > nul
 
 
 REM consumer
-"%2" %proxy_address% "%4" %receiver_folder% %beamtime_id% 2 %token% 1000 0 > out.txt
+"%2" %proxy_address% %receiver_folder% %beamtime_id% 2 %token% 1000 0 > out.txt
 type out.txt
 findstr /i /l /c:"Processed 3 file(s)" out.txt || goto :error
 findstr /i /l /c:"hello1" out.txt || goto :error
 findstr /i /l /c:"hello2" out.txt || goto :error
 findstr /i /l /c:"hello3" out.txt || goto :error
+findstr /i /l /c:"Using connection type: No connection" out.txt || goto :error
 
 
 goto :clean
diff --git a/tests/automatic/full_chain/simple_chain_metadata/CMakeLists.txt b/tests/automatic/full_chain/simple_chain_metadata/CMakeLists.txt
index dfc7e117e..2ff284ef9 100644
--- a/tests/automatic/full_chain/simple_chain_metadata/CMakeLists.txt
+++ b/tests/automatic/full_chain/simple_chain_metadata/CMakeLists.txt
@@ -1,4 +1,4 @@
-set(TARGET_NAME full_chain_simple_chain_meta)
+set(TARGET_NAME full_chain_simple_chain_metadata)
 
 ################################
 # Testing
diff --git a/tests/automatic/full_chain/simple_chain_metadata/check_linux.sh b/tests/automatic/full_chain/simple_chain_metadata/check_linux.sh
index 34d5eda32..d766e7ae9 100644
--- a/tests/automatic/full_chain/simple_chain_metadata/check_linux.sh
+++ b/tests/automatic/full_chain/simple_chain_metadata/check_linux.sh
@@ -7,7 +7,6 @@ trap Cleanup EXIT
 producer_bin=$1
 consumer_bin=$2
 asapo_tool_bin=$3
-network_type=$4
 
 beamtime_id=asapo_test
 token=`$asapo_tool_bin token -secret auth_secret.key $beamtime_id`
@@ -40,7 +39,7 @@ echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detec
 
 nomad run nginx.nmd
 nomad run authorizer.nmd
-nomad run receiver_${network_type}.nmd
+nomad run receiver_tcp.nmd # Only use TCP because the consumer will only use metadata anyways
 nomad run discovery.nmd
 nomad run broker.nmd
 
@@ -50,6 +49,7 @@ echo "Start producer"
 mkdir -p ${receiver_folder}
 $producer_bin localhost:8400 ${beamtime_id} 100 0 1 0 1000
 
-echo "Start consumer in $network_type mode"
-$consumer_bin ${proxy_address} $network_type ${receiver_folder} ${beamtime_id} 2 $token 1000 1 | tee out
-cat out | grep "dummy_meta"
+echo "Start consumer in metadata only mode"
+$consumer_bin ${proxy_address} ${receiver_folder} ${beamtime_id} 2 $token 1000 1 | tee out
+grep "dummy_meta" out
+grep -i "Using connection type: No connection" out
diff --git a/tests/automatic/full_chain/simple_chain_metadata/check_windows.bat b/tests/automatic/full_chain/simple_chain_metadata/check_windows.bat
index 030dcec92..9dbba7db3 100644
--- a/tests/automatic/full_chain/simple_chain_metadata/check_windows.bat
+++ b/tests/automatic/full_chain/simple_chain_metadata/check_windows.bat
@@ -18,7 +18,7 @@ mkdir %receiver_folder%
 "%1" %proxy_address% %beamtime_id% 100 0 1 0 1000
 
 REM consumer
-"%2" %proxy_address% "%4" %receiver_folder% %beamtime_id% 2 %token% 5000  1 > out.txt
+"%2" %proxy_address% %receiver_folder% %beamtime_id% 2 %token% 5000  1 > out.txt
 type out.txt
 findstr /i /l /c:"dummy_meta"  out.txt || goto :error
 
diff --git a/tests/automatic/full_chain/simple_chain_usermeta_python/CMakeLists.txt b/tests/automatic/full_chain/simple_chain_usermeta_python/CMakeLists.txt
index 6ef2935a3..956e8dea6 100644
--- a/tests/automatic/full_chain/simple_chain_usermeta_python/CMakeLists.txt
+++ b/tests/automatic/full_chain/simple_chain_usermeta_python/CMakeLists.txt
@@ -12,4 +12,4 @@ else()
 endif()
 
 
-add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:dummy-data-producer> $<TARGET_PROPERTY:asapo,EXENAME> ${CMAKE_CURRENT_SOURCE_DIR} ${PYTHON_LIBS} ${Python_EXECUTABLE} tcp" nomem)
+add_script_test("${TARGET_NAME}" "$<TARGET_FILE:dummy-data-producer> $<TARGET_PROPERTY:asapo,EXENAME> ${CMAKE_CURRENT_SOURCE_DIR} ${PYTHON_LIBS} ${Python_EXECUTABLE}" nomem)
diff --git a/tests/automatic/full_chain/simple_chain_usermeta_python/check_linux.sh b/tests/automatic/full_chain/simple_chain_usermeta_python/check_linux.sh
index 3a64f5856..64671af15 100644
--- a/tests/automatic/full_chain/simple_chain_usermeta_python/check_linux.sh
+++ b/tests/automatic/full_chain/simple_chain_usermeta_python/check_linux.sh
@@ -6,7 +6,6 @@ trap Cleanup EXIT
 
 producer_bin=$1
 asapo_tool_bin=$2
-network_type=$6
 
 beamtime_id=asapo_test
 token=`$asapo_tool_bin token -secret auth_secret.key $beamtime_id`
@@ -39,7 +38,7 @@ echo "db.${beamtime_id}_detector.insert({dummy:1})" | mongo ${beamtime_id}_detec
 
 nomad run nginx.nmd
 nomad run authorizer.nmd
-nomad run receiver_${network_type}.nmd
+nomad run receiver_tcp.nmd # Only use TCP because the consumer will only use metadata anyways
 nomad run discovery.nmd
 nomad run broker.nmd
 
@@ -52,7 +51,7 @@ $producer_bin localhost:8400 ${beamtime_id} 100 100 1 0 100
 export PYTHONPATH=$4:${PYTHONPATH}
 export Python_EXECUTABLE=$5
 
-echo "Start python consumer in $network_type mode"
-$Python_EXECUTABLE $3/get_user_meta.py $proxy_address $network_type $receiver_folder $beamtime_id $token new | tee out
-cat out | grep "found images: 100"
-cat out | grep "test100"
+echo "Start python consumer in metadata only mode"
+$Python_EXECUTABLE $3/get_user_meta.py $proxy_address $receiver_folder $beamtime_id $token new | tee out
+grep "found images: 100" out
+grep "test100" out
diff --git a/tests/automatic/full_chain/simple_chain_usermeta_python/check_windows.bat b/tests/automatic/full_chain/simple_chain_usermeta_python/check_windows.bat
index 35b072e06..2a67b0c4a 100644
--- a/tests/automatic/full_chain/simple_chain_usermeta_python/check_windows.bat
+++ b/tests/automatic/full_chain/simple_chain_usermeta_python/check_windows.bat
@@ -21,7 +21,7 @@ mkdir %receiver_folder%
 REM consumer
 set PYTHONPATH=%4
 
-python3 %3/get_user_meta.py %proxy_address% "%6" %receiver_folder% %beamtime_id%  %token% new > out
+python3 %3/get_user_meta.py %proxy_address% %receiver_folder% %beamtime_id%  %token% new > out
 type out
 type out | findstr /c:"found images: 100" || goto :error
 type out | findstr /c:"test100" || goto :error
diff --git a/tests/automatic/full_chain/simple_chain_usermeta_python/get_user_meta.py b/tests/automatic/full_chain/simple_chain_usermeta_python/get_user_meta.py
index 6cd6b6651..eaa115726 100644
--- a/tests/automatic/full_chain/simple_chain_usermeta_python/get_user_meta.py
+++ b/tests/automatic/full_chain/simple_chain_usermeta_python/get_user_meta.py
@@ -3,15 +3,11 @@ from __future__ import print_function
 import asapo_consumer
 import sys
 
-source, network_type, path, beamtime, token, group_id = sys.argv[1:]
+source, path, beamtime, token, group_id = sys.argv[1:]
 
-broker = asapo_consumer.create_server_broker(source,path,True, beamtime,"",token,60000,network_type)
+broker = asapo_consumer.create_server_broker(source,path,True, beamtime,"",token,60000)
 
 images = broker.query_images("meta.user_meta regexp 'test*' order by _id")
 
 print ('found images:',len(images))
 print (images[99]['meta']['user_meta'])
-print ('Network mode:', broker.current_connection_type())
-
-
-
diff --git a/tests/automatic/full_chain/two_beamlines/CMakeLists.txt b/tests/automatic/full_chain/two_beamlines/CMakeLists.txt
index 6b3d480a5..d33b9b592 100644
--- a/tests/automatic/full_chain/two_beamlines/CMakeLists.txt
+++ b/tests/automatic/full_chain/two_beamlines/CMakeLists.txt
@@ -5,3 +5,4 @@ set(TARGET_NAME full_chain_two_beamlines)
 ################################
 prepare_asapo()
 add_script_test("${TARGET_NAME}-tcp" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME> tcp" nomem)
+add_script_test("${TARGET_NAME}-fabric" "$<TARGET_FILE:dummy-data-producer> $<TARGET_FILE:getnext_broker> $<TARGET_PROPERTY:asapo,EXENAME> fabric" nomem)
diff --git a/tests/automatic/full_chain/two_beamlines/check_linux.sh b/tests/automatic/full_chain/two_beamlines/check_linux.sh
index 472f98e7d..f6c7e26f0 100644
--- a/tests/automatic/full_chain/two_beamlines/check_linux.sh
+++ b/tests/automatic/full_chain/two_beamlines/check_linux.sh
@@ -50,7 +50,7 @@ echo "db.${beamtime_id2}_${stream}.insert({dummy:1})" | mongo ${beamtime_id2}_${
 
 nomad run nginx.nmd
 nomad run authorizer.nmd
-nomad run receiver_tcp.nmd
+nomad run receiver_${network_type}.nmd
 nomad run discovery.nmd
 nomad run broker.nmd
 
@@ -64,5 +64,11 @@ $producer_bin localhost:8400 ${beamtime_id2} 100 900 4 0 100 &
 #producerid=`echo $!`
 
 echo "Start consumers in $network_type mode"
-$consumer_bin ${proxy_address} $network_type ${receiver_folder1} ${beamtime_id1} 2 $token1 12000 0  | tee /dev/stderr | grep "Processed 1000 file(s)"
-$consumer_bin ${proxy_address} $network_type ${receiver_folder2} ${beamtime_id2} 2 $token2 12000 0 | tee /dev/stderr | grep "Processed 900 file(s)"
+$consumer_bin ${proxy_address} ${receiver_folder1} ${beamtime_id1} 2 $token1 12000 0 | tee /dev/stderr consumer_1.out
+$consumer_bin ${proxy_address} ${receiver_folder2} ${beamtime_id2} 2 $token2 12000 0 | tee /dev/stderr consumer_2.out
+
+grep "from memory buffer: 1000" consumer_1.out
+grep -i "Using connection type: $network_type" consumer_1.out
+
+grep "from memory buffer: 900" consumer_2.out
+grep -i "Using connection type: $network_type" consumer_2.out
diff --git a/tests/automatic/full_chain/two_beamlines/check_windows.bat b/tests/automatic/full_chain/two_beamlines/check_windows.bat
index cc8f94fe5..b0c525914 100644
--- a/tests/automatic/full_chain/two_beamlines/check_windows.bat
+++ b/tests/automatic/full_chain/two_beamlines/check_windows.bat
@@ -33,11 +33,11 @@ start /B "" "%1" %proxy_address% %beamtime_id2% 100 900 4 0 100
 ping 1.0.0.0 -n 1 -w 100 > nul
 
 REM consumer
-"%2" %proxy_address% "%4" %receiver_folder1% %beamtime_id1% 2 %token1% 12000  0 > out1.txt
+"%2" %proxy_address% %receiver_folder1% %beamtime_id1% 2 %token1% 12000  0 > out1.txt
 type out1.txt
 findstr /i /l /c:"Processed 1000 file(s)"  out1.txt || goto :error
 
-"%2" %proxy_address% "%4" %receiver_folder2% %beamtime_id2% 2 %token2% 12000  0 > out2.txt
+"%2" %proxy_address% %receiver_folder2% %beamtime_id2% 2 %token2% 12000  0 > out2.txt
 type out2.txt
 findstr /i /l /c:"Processed 900 file(s)"  out2.txt || goto :error
 
diff --git a/tests/automatic/full_chain/two_streams/check_linux.sh b/tests/automatic/full_chain/two_streams/check_linux.sh
index be07a78bd..fbbe34ab9 100644
--- a/tests/automatic/full_chain/two_streams/check_linux.sh
+++ b/tests/automatic/full_chain/two_streams/check_linux.sh
@@ -55,5 +55,11 @@ $producer_bin localhost:8400 ${beamtime_id}%${stream1} 100 1000 4 0 100 &
 $producer_bin localhost:8400 ${beamtime_id}%${stream2} 100 900 4 0 100 &
 
 echo "Start consumers in $network_type mode"
-$consumer_bin ${proxy_address} $network_type ${receiver_folder} ${beamtime_id}%${stream1} 2 $token 10000 0  | tee /dev/stderr | grep "Processed 1000 file(s)"
-$consumer_bin ${proxy_address} $network_type ${receiver_folder} ${beamtime_id}%${stream2} 2 $token 10000 0 | tee /dev/stderr | grep "Processed 900 file(s)"
+$consumer_bin ${proxy_address} ${receiver_folder} ${beamtime_id}%${stream1} 2 $token 10000 0 | tee /dev/stderr consumer_1.out
+$consumer_bin ${proxy_address} ${receiver_folder} ${beamtime_id}%${stream2} 2 $token 10000 0 | tee /dev/stderr consumer_2.out
+
+grep "from memory buffer: 1000" consumer_1.out
+grep -i "Using connection type: $network_type" consumer_1.out
+
+grep "from memory buffer: 900" consumer_2.out
+grep -i "Using connection type: $network_type" consumer_2.out
diff --git a/tests/automatic/full_chain/two_streams/check_windows.bat b/tests/automatic/full_chain/two_streams/check_windows.bat
index 89dcd5dc4..fd2b9268d 100644
--- a/tests/automatic/full_chain/two_streams/check_windows.bat
+++ b/tests/automatic/full_chain/two_streams/check_windows.bat
@@ -24,11 +24,11 @@ start /B "" "%1" %proxy_address% %beamtime_id%%%%stream2% 100 900 4 0 100
 ping 1.0.0.0 -n 1 -w 100 > nul
 
 REM consumer
-"%2" %proxy_address% "%4" %receiver_folder% %beamtime_id%%%%stream1% 2 %token% 12000  0 > out1.txt
+"%2" %proxy_address% %receiver_folder% %beamtime_id%%%%stream1% 2 %token% 12000  0 > out1.txt
 type out1.txt
 findstr /i /l /c:"Processed 1000 file(s)"  out1.txt || goto :error
 
-"%2" %proxy_address% "%4" %receiver_folder% %beamtime_id%%%%stream2% 2 %token% 12000  0 > out2.txt
+"%2" %proxy_address% %receiver_folder% %beamtime_id%%%%stream2% 2 %token% 12000  0 > out2.txt
 type out2.txt
 findstr /i /l /c:"Processed 900 file(s)"  out2.txt || goto :error
 
diff --git a/tests/automatic/high_avail/broker_mongo_restart/check_linux.sh b/tests/automatic/high_avail/broker_mongo_restart/check_linux.sh
index 0f455e620..440d88d8a 100755
--- a/tests/automatic/high_avail/broker_mongo_restart/check_linux.sh
+++ b/tests/automatic/high_avail/broker_mongo_restart/check_linux.sh
@@ -92,7 +92,7 @@ producerid=`echo $!`
 wait
 
 echo "Start consumer in $network_type mode"
-$consumer_bin ${proxy_address} $network_type ${receiver_folder} ${beamtime_id} 2 $token 10000 0 &> output.txt &
+$consumer_bin ${proxy_address} ${receiver_folder} ${beamtime_id} 2 $token 10000 0 &> output.txt &
 workerid=`echo $!`
 
 sleep 2
diff --git a/tests/automatic/high_avail/services_restart/check_linux.sh b/tests/automatic/high_avail/services_restart/check_linux.sh
index c47355c08..dd3253f2f 100644
--- a/tests/automatic/high_avail/services_restart/check_linux.sh
+++ b/tests/automatic/high_avail/services_restart/check_linux.sh
@@ -46,7 +46,7 @@ $producer_bin localhost:8400 ${beamtime_id} 100 $5 4 0 100 &
 #producerid=`echo $!`
 
 echo "Start consumer in $network_type mode"
-$consumer_bin ${proxy_address} $network_type dummy_path ${beamtime_id} 2 $token 30000 1 &> output.txt &
+$consumer_bin ${proxy_address} dummy_path ${beamtime_id} 2 $token 30000 1 &> output.txt &
 
 sleep 1
 
diff --git a/tests/manual/performance_broker_receiver/getlast_broker.cpp b/tests/manual/performance_broker_receiver/getlast_broker.cpp
index 0582d55b6..d4ce9cf51 100644
--- a/tests/manual/performance_broker_receiver/getlast_broker.cpp
+++ b/tests/manual/performance_broker_receiver/getlast_broker.cpp
@@ -16,9 +16,21 @@ using asapo::Error;
 std::string group_id = "";
 std::mutex lock;
 
+
+inline std::string ConnectionTypeToString(asapo::NetworkConnectionType type) {
+    switch (type) {
+    case asapo::NetworkConnectionType::kUndefined:
+        return "No connection";
+    case asapo::NetworkConnectionType::kAsapoTcp:
+        return "TCP";
+    case asapo::NetworkConnectionType::kFabric:
+        return "Fabric";
+    }
+    return "Unknown type";
+}
+
 struct Args {
     std::string server;
-    std::string network_type;
     std::string file_path;
     std::string beamtime_id;
     std::string token;
@@ -49,7 +61,7 @@ std::vector<std::thread> StartThreads(const Args& params,
         asapo::FileInfo fi;
         Error err;
         auto broker = asapo::DataBrokerFactory::CreateServerBroker(params.server, params.file_path, true,
-                      asapo::SourceCredentials{params.beamtime_id, "", "", params.token}, params.network_type, &err);
+                      asapo::SourceCredentials{params.beamtime_id, "", "", params.token}, &err);
         broker->SetTimeout((uint64_t) params.timeout_ms);
         asapo::FileData data;
 
@@ -103,7 +115,8 @@ std::vector<std::thread> StartThreads(const Args& params,
     return threads;
 }
 
-int ReadAllData(const Args& params, uint64_t* duration_ms, int* nerrors, int* nbuf, int* nfiles_total) {
+int ReadAllData(const Args& params, uint64_t* duration_ms, int* nerrors, int* nbuf, int* nfiles_total,
+                asapo::NetworkConnectionType* connection_type) {
     asapo::FileInfo fi;
     system_clock::time_point t1 = system_clock::now();
 
@@ -111,6 +124,7 @@ int ReadAllData(const Args& params, uint64_t* duration_ms, int* nerrors, int* nb
     std::vector<int> errors(params.nthreads, 0);
     std::vector<int> nfiles_frombuf(params.nthreads, 0);
     std::vector<int> nfiles_total_in_datasets(params.nthreads, 0);
+    std::vector<asapo::NetworkConnectionType> connection_types(params.nthreads, asapo::NetworkConnectionType::kUndefined);
 
     auto threads = StartThreads(params, &nfiles, &errors, &nfiles_frombuf, &nfiles_total_in_datasets);
     WaitThreads(&threads);
@@ -123,6 +137,32 @@ int ReadAllData(const Args& params, uint64_t* duration_ms, int* nerrors, int* nb
     system_clock::time_point t2 = system_clock::now();
     auto duration_read = std::chrono::duration_cast<std::chrono::milliseconds>(t2 - t1);
     *duration_ms = duration_read.count();
+
+    // The following two loops will check if all threads that processed some data were using the same network type
+    {
+        int firstThreadThatActuallyProcessedData = 0;
+        for (int i = 0; i < params.nthreads; i++) {
+            if (nfiles[i] > 0) {
+                firstThreadThatActuallyProcessedData = i;
+                break;
+            }
+        }
+
+        *connection_type = connection_types[firstThreadThatActuallyProcessedData];
+        for (int i = 0; i < params.nthreads; i++) {
+            if (*connection_type != connection_types[i] && nfiles[i] > 0) {
+                // The output will look like this:
+                // ERROR thread[0](processed 5 files) connection type is 'No connection' but thread[1](processed 3 files) is 'TCP'
+
+                std::cout << "ERROR thread[" << i << "](processed " << nfiles[i] << " files) connection type is '" <<
+                          ConnectionTypeToString(connection_types[i]) << "' but thread["
+                          << firstThreadThatActuallyProcessedData << "](processed "
+                          << nfiles[firstThreadThatActuallyProcessedData] << " files) is '" << ConnectionTypeToString(
+                              *connection_type) << "'" << std::endl;
+            }
+        }
+    }
+
     return n_total;
 }
 
@@ -138,19 +178,19 @@ int main(int argc, char* argv[]) {
         exit(EXIT_FAILURE);
     }
     params.server = std::string{argv[1]};
-    params.network_type = std::string{argv[2]};
-    params.file_path = std::string{argv[3]};
-    params.beamtime_id = std::string{argv[4]};
-    params.nthreads = atoi(argv[5]);
-    params.token = std::string{argv[6]};
-    params.timeout_ms = atoi(argv[7]);
-    params.read_data = atoi(argv[8]) != 1;
-    if (argc == 10) {
-        params.datasets = atoi(argv[9]) == 1;
+    params.file_path = std::string{argv[2]};
+    params.beamtime_id = std::string{argv[3]};
+    params.nthreads = atoi(argv[4]);
+    params.token = std::string{argv[5]};
+    params.timeout_ms = atoi(argv[6]);
+    params.read_data = atoi(argv[7]) != 1;
+    if (argc == 9) {
+        params.datasets = atoi(argv[8]) == 1;
     }
     uint64_t duration_ms;
     int nerrors, nbuf, nfiles_total;
-    auto nfiles = ReadAllData(params, &duration_ms, &nerrors, &nbuf, &nfiles_total);
+    asapo::NetworkConnectionType connectionType;
+    auto nfiles = ReadAllData(params, &duration_ms, &nerrors, &nbuf, &nfiles_total, &connectionType);
     std::cout << "Processed " << nfiles << (params.datasets ? " dataset(s)" : " file(s)") << std::endl;
     if (params.datasets) {
         std::cout << "  with " << nfiles_total << " file(s)" << std::endl;
@@ -163,5 +203,8 @@ int main(int argc, char* argv[]) {
     std::cout << "Errors : " << nerrors << std::endl;
     std::cout << "Elapsed : " << duration_ms << "ms" << std::endl;
     std::cout << "Rate : " << 1000.0f * nfiles / (duration_ms) << " Hz" << std::endl;
+
+    std::cout << "Using connection type: " << ConnectionTypeToString(connectionType) << std::endl;
+
     return nerrors == 0 ? 0 : 1;
 }
diff --git a/tests/manual/performance_full_chain_simple/test.sh b/tests/manual/performance_full_chain_simple/test.sh
index 733b99f2c..56b1536ad 100755
--- a/tests/manual/performance_full_chain_simple/test.sh
+++ b/tests/manual/performance_full_chain_simple/test.sh
@@ -6,6 +6,7 @@ trap Cleanup EXIT
 
 #clean-up
 Cleanup() {
+echo cleanup
 set +e
 ssh ${receiver_node} rm -f ${receiver_dir}/files/${beamline}/${beamtime_id}/*
 ssh ${receiver_node} killall receiver
diff --git a/tests/manual/python_tests/consumer/consumer_api.py b/tests/manual/python_tests/consumer/consumer_api.py
index b11cb9907..1db3daeb0 100644
--- a/tests/manual/python_tests/consumer/consumer_api.py
+++ b/tests/manual/python_tests/consumer/consumer_api.py
@@ -3,8 +3,8 @@ from __future__ import print_function
 import asapo_consumer
 import sys
 
-source, network_type, path, beamtime, token = sys.argv[1:]
-broker = asapo_consumer.create_server_broker(source,path,False, beamtime,"",token,1000,network_type)
+source, path, beamtime, token = sys.argv[1:]
+broker = asapo_consumer.create_server_broker(source,path,False, beamtime,"",token,1000)
 group_id = broker.generate_group_id()
 
 
diff --git a/tests/manual/python_tests/consumer/test.sh b/tests/manual/python_tests/consumer/test.sh
index b093b5757..9c9712593 100644
--- a/tests/manual/python_tests/consumer/test.sh
+++ b/tests/manual/python_tests/consumer/test.sh
@@ -1 +1 @@
-python3 consumer_api.py asapo-services.desy.de:8400 tcp asapo_test /shared_data/test_facility/gpfs/test/2019/data/asapo_test KmUDdacgBzaOD3NIJvN1NmKGqWKtx0DK-NyPjdpeWkc=
+python3 consumer_api.py asapo-services.desy.de:8400 asapo_test /shared_data/test_facility/gpfs/test/2019/data/asapo_test KmUDdacgBzaOD3NIJvN1NmKGqWKtx0DK-NyPjdpeWkc=
diff --git a/tests/manual/python_tests/consumer/test_asap3.sh b/tests/manual/python_tests/consumer/test_asap3.sh
index 1f22a9782..6f43030a3 100755
--- a/tests/manual/python_tests/consumer/test_asap3.sh
+++ b/tests/manual/python_tests/consumer/test_asap3.sh
@@ -1,3 +1,3 @@
 export PYTHONPATH=/Users/yakubov/projects/asapo/cmake-build-debug/consumer/api/python
 export token=KmUDdacgBzaOD3NIJvN1NmKGqWKtx0DK-NyPjdpeWkc=
-python3 consumer_api.py asap3-utl.desy.de:8400 tcp /gpfs/asapo/shared/test_dir/test_facility/gpfs/test/2019/data/asapo_test asapo_test $token
+python3 consumer_api.py asap3-utl.desy.de:8400 /gpfs/asapo/shared/test_dir/test_facility/gpfs/test/2019/data/asapo_test asapo_test $token
diff --git a/tests/manual/python_tests/consumer/test_k8s.sh b/tests/manual/python_tests/consumer/test_k8s.sh
index fc1052a55..9ee6bb429 100755
--- a/tests/manual/python_tests/consumer/test_k8s.sh
+++ b/tests/manual/python_tests/consumer/test_k8s.sh
@@ -1,4 +1,4 @@
 export PYTHONPATH=/Users/yakubov/projects/asapo/cmake-build-debug/consumer/api/python
 export token=IEfwsWa0GXky2S3MkxJSUHJT1sI8DD5teRdjBUXVRxk=
-python3 consumer_api.py tcp gest-k8s-test2.desy.de/yakser /test_offline/test_facility/gpfs/test/2019/data/asapo_test asapo_test $token
+python3 consumer_api.py gest-k8s-test2.desy.de/yakser /test_offline/test_facility/gpfs/test/2019/data/asapo_test asapo_test $token
 #python3 getnext.py gest-k8s-test2.desy.de/yakser /test_offline/test_facility/gpfs/test/2019/data/asapo_test asapo_test $token new
-- 
GitLab