Пример #1
0
def main():

    # ------------------------------------------------------------------------ #
    # 0. Subscribe to the broker
    # ------------------------------------------------------------------------ #

    receiver = Receiver()

    # Connect to the data hub
    receiver.connect(host=DATA_HUB_IP, uname=DATA_HUB_UNAME, pwd=DATA_HUB_PWD)

    # Connect to the exchange
    receiver.get_data_from_exchange(ex_name=EX_NAME,
                                    topic=SUB_TOPIC,
                                    callback=process_data)
Пример #2
0
def main():

    # ------------------------------------------------------------------------ #
    # 0. Subscribe to the broker
    # ------------------------------------------------------------------------ #

    receiver = Receiver()

    # Connect to the data hub
    uname = "admin"
    password = "******"
    receiver.connect(host=DATA_HUB_IP, uname=uname, pwd=password)

    # Connect to the exchange
    receiver.get_data_from_exchange(ex_name=EX_NAME,
                                    topic=SUB_TOPIC,
                                    callback=process_data)