Beispiel #1
0
    def _process_message(self, ch, method, properties, message):
        print(f'A new message was received: {message}')
        msg_type = ['incoming', 'outgoing']

        storage = BigQuery()
        message = Message(f'1', '1', random.choice(msg_type),
                          message.decode('utf-8'))
        storage.insert_message(message)
        print('message send at ', datetime.utcnow())