Fotis Paraskevopoulos 19bdfeea69 Initial commit
Change-Id: I03c605dfaa884b6c7aab3e52259855eb2110fac5
2023-12-14 23:22:00 +02:00

28 lines
948 B
Python

import logging
from exn import connector, core
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
logging.getLogger('exn.connector').setLevel(logging.DEBUG)
class Bootstrap(connector.ConnectorHandler):
def on_message(self, key, address, body, context, **kwargs):
logging.info(f"Received {key} => {address}")
if key == 'ui_health':
logging.info(f"I am healthy => {body}")
if key == 'ui_all':
logging.info(f"These are my preferences => {body}")
connector = connector.EXN('ui', handler=Bootstrap(),
consumers=[
core.consumer.Consumer('ui_health', 'health', topic=True),
core.consumer.Consumer('ui_all', 'eu.nebulouscloud.ui.preferences.>', topic=True,
fqdn=True)
])
connector.start()