From 2ae3d0989a3cc6ef73c93c79436cc3a81d33c96c Mon Sep 17 00:00:00 2001 From: Jan David Mol <mol@astron.nl> Date: Mon, 29 Apr 2019 10:08:14 +0000 Subject: [PATCH] SW-657: Use scu001/199 directly for LCS/Messaging/python, to avoid relying on qpid infrastructure for our services. --- LCS/Messaging/python/messaging/messagebus.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/LCS/Messaging/python/messaging/messagebus.py b/LCS/Messaging/python/messaging/messagebus.py index f3079f2fef3..0d2bb0c38a2 100644 --- a/LCS/Messaging/python/messaging/messagebus.py +++ b/LCS/Messaging/python/messaging/messagebus.py @@ -30,6 +30,7 @@ from lofar.messaging.exceptions import MessageBusError, MessageFactoryError from lofar.messaging.messages import to_qpid_message, MESSAGE_FACTORY from lofar.common.util import raise_exception, is_iterable from lofar.common.datetimeutils import to_milliseconds_since_unix_epoch, from_milliseconds_since_unix_epoch +from lofar.common import isProductionEnvironment, isTestEnvironment import proton import proton.utils @@ -43,12 +44,17 @@ from copy import deepcopy logger = logging.getLogger(__name__) # Default settings for often used parameters. -DEFAULT_BROKER = "localhost:5672" +if isProductionEnvironment(): + DEFAULT_BROKER = "scu001.control.lofar" +elif isTestEnvironment(): + DEFAULT_BROKER = "scu199.control.lofar" +else: # development environment + DEFAULT_BROKER = "localhost" + DEFAULT_BROKER_OPTIONS = {'reconnect': True} DEFAULT_RECEIVER_CAPACITY = 128 DEFAULT_TIMEOUT = 5 - class _ProtonSubjectFilter(proton.reactor.Filter): """ helper class for filtering by subject -- GitLab