barryp / py-amqplib

Python client for the Advanced Message Queuing Procotol (AMQP)
GNU Lesser General Public License v2.1
24 stars 10 forks source link

u'COMMAND_INVALID - unimplemented method', (60, 90), 'Channel.basic_reject' #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Which version of amqplib are you using?

0.6.1

Which broker are you using (RabbitMQ?) which version?

RabbitMQ

Which version of Python?

Python 2.5.2

What steps will reproduce the problem?

#!/usr/bin/python2.5

from amqplib import client_0_8 as amqp

conn = amqp.Connection(host="localhost:5672", userid="guest",
password="guest", virtual_host="/", insist=False)
chan = conn.channel()

chan.queue_declare(queue="po_box", durable=True, exclusive=False,
auto_delete=False)
chan.exchange_declare(exchange="sorting_room", type="direct", durable=True,
auto_delete=False,)
chan.queue_bind(queue="po_box", exchange="sorting_room", routing_key="jason")

def recv_callback(msg):
  msg.channel.basic_reject(msg.delivery_tag, requeue=False)

chan.basic_consume(queue='po_box', no_ack=True, callback=recv_callback,
consumer_tag="testtag")
while True:
    chan.wait()
chan.basic_cancel("testtag")

chan.close()
conn.close()

What is the expected output? What do you see instead?

Traceback (most recent call last):
  File "amqp_consumer.py", line 17, in <module>
    chan.wait()
  File
"/usr/lib/python2.5/site-packages/amqplib/client_0_8/abstract_channel.py",
line 89, in wait
    self.channel_id, allowed_methods)
  File "/usr/lib/python2.5/site-packages/amqplib/client_0_8/connection.py",
line 218, in _wait_method
    self.wait()
  File
"/usr/lib/python2.5/site-packages/amqplib/client_0_8/abstract_channel.py",
line 105, in wait
    return amqp_method(self, args)
  File "/usr/lib/python2.5/site-packages/amqplib/client_0_8/connection.py",
line 367, in _close
    raise AMQPConnectionException(reply_code, reply_text, (class_id,
method_id))
amqplib.client_0_8.exceptions.AMQPConnectionException: (503,
u'COMMAND_INVALID - unimplemented method', (60, 90), 'Channel.basic_reject')

Please provide any additional information below.

Method appears to be implemented in amqplib/client_0_8/channel.py and the
inline comment/documentation has no mention of this being unusable or
unimplemented? (missing METHOD_MAP entry?)

Original issue reported on code.google.com by gibs...@gmail.com on 19 Oct 2009 at 9:03

GoogleCodeExporter commented 9 years ago
It seems that RabbitMQ is where the method is not implemented.  There's a 
similar
ticket for the Ruby client

  http://github.com/tmm1/amqp/issues#issue/5

which points to a discussion message mentioning this.

  http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2009-February/002853.html

So being a broker issue, this doesn't seem to be something we can fix on the 
client.
 Thanks for the report.

Original comment by barry.pe...@gmail.com on 19 Oct 2009 at 3:21