【问题标题】:rabbitmq server does not receive messages from a python clientrabbitmq 服务器不接收来自 python 客户端的消息
【发布时间】:2015-09-09 07:54:42
【问题描述】:

我正在尝试向rabbitmq 发布消息。这适用于具有相同代码的生产环境环境,所以我怀疑这是一个配置问题。

rbqueue = RabbitMQClientQueue('cn-dip-v3', host = rabbitmq_config['host'], username = rabbitmq_config['user'], password = rabbitmq_config['password'])

channel = rbqueue.connection.channel()
args = {"x-max-priority": 10}
channel.queue_declare(queue='cn-dip-v3', durable=True, arguments=args)

result = channel.queue_declare(exclusive=True)
callback_queue = result.method.queue

msgBody = json.dumps({"ohad":123})
# may happen that sendResponseToDal is True but there is no sendResponseToDal method on server side
data = {"body":msgBody,"queue_response" : False}
if responseHandler:
    data["queue_response"] = True

corrID = str(uuid.uuid4())

>>> channel.basic_publish(exchange='',routing_key='cn-dip-v3',properties=pika.BasicProperties(priority = 10, reply_to = callback_queue,correlation_id = corrID,),body=json.dumps(data))
>>> 

queue_declare 有效。如果我删除它并运行同一行,则定义队列。我在管理面板中看到它,奇怪的是在端口 55672 而不是 15672。

另外,每次我运行channel.basic_publish 之后,我都会看到另一个回调队列被添加到rabbitmq 管理中的队列部分。

所缺少的只是到达那里的信息。

【问题讨论】:

  • 你对端口的评论让我怀疑你有不同版本的消息代理运行。 RabbitMQ 3.0 之前版本的端口是 55672。3.0 和更高版本有很大差异。
  • 哦,伙计...... 4 小时的工作......非常感谢!
  • 我应该作为答案发布!哈哈

标签: python rabbitmq


【解决方案1】:

您对端口的评论让我怀疑您使用了不同版本的消息代理。 RabbitMQ 3.0 之前的版本的端口是 55672。3.0 和更高版本有很大的不同。

【讨论】:

    猜你喜欢
    • 2013-03-28
    • 1970-01-01
    • 2018-04-30
    • 1970-01-01
    • 2016-08-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多