tech-blog icon indicating copy to clipboard operation
tech-blog copied to clipboard

我的个人技术博客(Python、Django、Docker、Go、Redis、ElasticSearch、Kafka、Linux)

Results 1 tech-blog issues
Sort by recently updated
recently updated
newest added

我在生产者产生的消息推送到rabbitmq上(我指定了队列名),此时消费者尚未消费,但是在界面的rabbitmq后台获取不了消息。先运行消费者程序就能够正常获取到消息。 ```python # 生产者代码 import pika import sys credentials = pika.PlainCredentials('admin', 'admin') # mq用户名和密码 # 虚拟队列需要指定参数 virtual_host,如果是默认的可以不填。 connection = pika.BlockingConnection(pika.ConnectionParameters(host='127.0.0.1', port=5672, virtual_host='rabbitmq', credentials=credentials)) channel = connection.channel() channel.queue_declare(queue='wx_message', durable=False) # channel.queue_bind(exchange='direct_logs',...