我安装了rabbitmq并正常工作,我知道如何接收日志,但不知道如何将其显示到带烧瓶的UI.
flask_app.py
from flask import Flask
from threading import Thread
app = Flask(__name__)
import pika
connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))
channel = connection.channel()
channel.exchange_declare(exchange='logs',
type='fanout')
result = channel.queue_declare(exclusive=True)
queue_name = result.method.queue
channel.queue_bind(exchange='logs',
queue=queue_name)
print('[*] Waiting for logs. To exit press CTRL+C')
def callback(ch, method, properties, body):
print(body)
channel.basic_consume(callback,
queue=queue_name,
no_ack=True)
thread = Thread(channel.start_consuming())
thread.start()
@app.route('/')
def index():
return 'hi'
Run Code Online (Sandbox Code Playgroud)
我不知道如何使用多线程来运行flask应用程序并不断从队列接收日志.
我们使用 Metabase 来查询 Amazon Redshift DB。
在AWS UI查询部分,我可以看到元数据库用户ID和相应的queryHash。
-- Metabase:: userID: 201 queryType: native queryHash: e0f499f3bc109a46cdf4e686fa06fb6379ec01265640ecc3f45365349b7c6e3f
现在,我必须找出这个 queryHash 的问题 id 和仪表板 id 是什么?这可能吗,如果是的话怎么办?
提前致谢!!