需要有关此 Kombu 错误的帮助

发布于 2024-11-03 18:51:29 字数 3396 浏览 7 评论 0原文

请原谅 python 解释器的复制和粘贴,但我正在尝试使用 Kombu,但我似乎无法创建消费者。请帮忙,我在这里完全陷入黑暗。

>>> from kombu.messaging import Consumer, Producer
>>> from kombu.entity import Exchange, Queue
>>> x = Exchange("stmt",type="topic")
>>> helloQ = Queue("hello", exchange=x, routing_key="stmt.hello")
>>>
>>> from kombu.connection import BrokerConnection
>>> conn = BrokerConnection("scheduledb.lab.compete.com", "clippy", "clippy", "clippy")
>>> channel = conn.channel()
>>> c = Consumer(channel, helloQ)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/kombu-1.0.6-py2.6.egg/kombu/messaging.py", line 231, in __init__
self.declare()
File "/usr/lib/python2.6/site-packages/kombu-1.0.6-py2.6.egg/kombu/messaging.py", line 241, in declare
    queue.declare()
File "/usr/lib/python2.6/site-packages/kombu-1.0.6-py2.6.egg/kombu/entity.py", line 362, in declare
    self.name and self.queue_declare(nowait, passive=False),
File "/usr/lib/python2.6/site-packages/kombu-1.0.6-py2.6.egg/kombu/entity.py", line 380, in queue_declare
    nowait=nowait)
  File "/usr/lib/python2.6/site-packages/kombu-1.0.6-py2.6.egg/kombu/syn.py", line 14, in blocking
    return __sync_current(fun, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/kombu-1.0.6-py2.6.egg/kombu/syn.py", line 30, in __blocking__
    return fun(*args, **kwargs)
File "build/bdist.cygwin-1.7.8-i686/egg/amqplib/client_0_8/channel.py", line 1294, in queue_declare
File "build/bdist.cygwin-1.7.8-i686/egg/amqplib/client_0_8/abstract_channel.py", line 89, in wait
File "build/bdist.cygwin-1.7.8-i686/egg/amqplib/client_0_8/connection.py", line 218, in _wait_method
File "build/bdist.cygwin-1.7.8-i686/egg/amqplib/client_0_8/abstract_channel.py", line 105, in wait
File "build/bdist.cygwin-1.7.8-i686/egg/amqplib/client_0_8/connection.py", line 367, in _close
amqplib.client_0_8.exceptions.AMQPConnectionException: (530, u"NOT_ALLOWED - parameters for queue 'hello' in vhost 'clippy' not equivalent", (50, 10), 'Channel.queue_declare')
>>> boundX = x(helloQ)
>>> c = Consumer(channel, helloQ)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/kombu-1.0.6-py2.6.egg/kombu/messaging.py", line 231, in __init__
    self.declare()
  File "/usr/lib/python2.6/site-packages/kombu-1.0.6-py2.6.egg/kombu/messaging.py", line 241, in declare
    queue.declare()
  File "/usr/lib/python2.6/site-packages/kombu-1.0.6-py2.6.egg/kombu/entity.py", line 361, in declare
    return (self.name and self.exchange.declare(nowait),
  File "/usr/lib/python2.6/site-packages/kombu-1.0.6-py2.6.egg/kombu/entity.py", line 151, in declare
nowait=nowait)
  File "/usr/lib/python2.6/site-packages/kombu-1.0.6-py2.6.egg/kombu/syn.py", line 14, in blocking
    return __sync_current(fun, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/kombu-1.0.6-py2.6.egg/kombu/syn.py", line 30, in __blocking__
     return fun(*args, **kwargs)
  File "build/bdist.cygwin-1.7.8-i686/egg/amqplib/client_0_8/channel.py", line 839, in exchange_declare
  File "build/bdist.cygwin-1.7.8-i686/egg/amqplib/client_0_8/abstract_channel.py", line 69, in _send_method
AttributeError: 'NoneType' object has no attribute 'method_writer'

Pardon the copy and paste from the python interpreter but I'm trying to play with Kombu but I can't seem to create a consumer. Please help, I'm utterly in the dark here.

>>> from kombu.messaging import Consumer, Producer
>>> from kombu.entity import Exchange, Queue
>>> x = Exchange("stmt",type="topic")
>>> helloQ = Queue("hello", exchange=x, routing_key="stmt.hello")
>>>
>>> from kombu.connection import BrokerConnection
>>> conn = BrokerConnection("scheduledb.lab.compete.com", "clippy", "clippy", "clippy")
>>> channel = conn.channel()
>>> c = Consumer(channel, helloQ)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/kombu-1.0.6-py2.6.egg/kombu/messaging.py", line 231, in __init__
self.declare()
File "/usr/lib/python2.6/site-packages/kombu-1.0.6-py2.6.egg/kombu/messaging.py", line 241, in declare
    queue.declare()
File "/usr/lib/python2.6/site-packages/kombu-1.0.6-py2.6.egg/kombu/entity.py", line 362, in declare
    self.name and self.queue_declare(nowait, passive=False),
File "/usr/lib/python2.6/site-packages/kombu-1.0.6-py2.6.egg/kombu/entity.py", line 380, in queue_declare
    nowait=nowait)
  File "/usr/lib/python2.6/site-packages/kombu-1.0.6-py2.6.egg/kombu/syn.py", line 14, in blocking
    return __sync_current(fun, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/kombu-1.0.6-py2.6.egg/kombu/syn.py", line 30, in __blocking__
    return fun(*args, **kwargs)
File "build/bdist.cygwin-1.7.8-i686/egg/amqplib/client_0_8/channel.py", line 1294, in queue_declare
File "build/bdist.cygwin-1.7.8-i686/egg/amqplib/client_0_8/abstract_channel.py", line 89, in wait
File "build/bdist.cygwin-1.7.8-i686/egg/amqplib/client_0_8/connection.py", line 218, in _wait_method
File "build/bdist.cygwin-1.7.8-i686/egg/amqplib/client_0_8/abstract_channel.py", line 105, in wait
File "build/bdist.cygwin-1.7.8-i686/egg/amqplib/client_0_8/connection.py", line 367, in _close
amqplib.client_0_8.exceptions.AMQPConnectionException: (530, u"NOT_ALLOWED - parameters for queue 'hello' in vhost 'clippy' not equivalent", (50, 10), 'Channel.queue_declare')
>>> boundX = x(helloQ)
>>> c = Consumer(channel, helloQ)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/kombu-1.0.6-py2.6.egg/kombu/messaging.py", line 231, in __init__
    self.declare()
  File "/usr/lib/python2.6/site-packages/kombu-1.0.6-py2.6.egg/kombu/messaging.py", line 241, in declare
    queue.declare()
  File "/usr/lib/python2.6/site-packages/kombu-1.0.6-py2.6.egg/kombu/entity.py", line 361, in declare
    return (self.name and self.exchange.declare(nowait),
  File "/usr/lib/python2.6/site-packages/kombu-1.0.6-py2.6.egg/kombu/entity.py", line 151, in declare
nowait=nowait)
  File "/usr/lib/python2.6/site-packages/kombu-1.0.6-py2.6.egg/kombu/syn.py", line 14, in blocking
    return __sync_current(fun, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/kombu-1.0.6-py2.6.egg/kombu/syn.py", line 30, in __blocking__
     return fun(*args, **kwargs)
  File "build/bdist.cygwin-1.7.8-i686/egg/amqplib/client_0_8/channel.py", line 839, in exchange_declare
  File "build/bdist.cygwin-1.7.8-i686/egg/amqplib/client_0_8/abstract_channel.py", line 69, in _send_method
AttributeError: 'NoneType' object has no attribute 'method_writer'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

甜味拾荒者 2024-11-10 18:51:29

添加到@asksol 的答案。如果您使用的是rabbitmq,您可以使用 rabbitmqctl 命令来列出队列详细信息并将这些设置与您自己的代码中的设置进行比较。希望这能为您提供足够的信息来检测冲突。

Adding to @asksol's answer. If you are using rabbitmq you can use the rabbitmqctl command to list the queue details and compare those settings with the settings in your own code. Hopefully that gives you enough information to detect the conflict.

双马尾 2024-11-10 18:51:29

查看错误

amqplib.client_0_8.exceptions.AMQPConnectionException: (530, u"NOT_ALLOWED - parameters for queue 'hello' in vhost 'clippy' not equivalent", (50, 10), 'Channel.queue_declare')

这意味着队列已经被声明,但带有其他参数而不是您所指定的参数
现在就宣布这一点。

Look at the error

amqplib.client_0_8.exceptions.AMQPConnectionException: (530, u"NOT_ALLOWED - parameters for queue 'hello' in vhost 'clippy' not equivalent", (50, 10), 'Channel.queue_declare')

This means the queue has already been declared, but with other parameters than what you
are declaring it with now.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文