RabbitMQ python tutorial

653 views
Skip to first unread message

duricu vlad

unread,
Apr 13, 2018, 8:51:31 AM4/13/18
to rabbitmq-users
Hey, I have installed pip install pika==0.11.0, as it is shown on the readme file, and after that I tried python receiver.py, and it gave me the following error:

Traceback (most recent call last):
  File "receive.py", line 9, in <module>
    channel.queue_declare(queue='hello')
  File "C:\Python36\lib\site-packages\pika\adapters\blocking_connection.py", line 2400, in queue_declare
    self._flush_output(declare_ok_result.is_ready)
  File "C:\Python36\lib\site-packages\pika\adapters\blocking_connection.py", line 1258, in _flush_output
    raise exceptions.ChannelClosed(method.reply_code, method.reply_text)
pika.exceptions.ChannelClosed: (406, "PRECONDITION_FAILED - inequivalent arg 'durable' for queue 'hello' in vhost '/': received 'false' but current is 'true'")

Even if I didn't modify anything. I tried also the spring-amqp example, and these works. Can you gave me a hint about what should I change?

Michael Klishin

unread,
Apr 13, 2018, 9:33:48 AM4/13/18
to rabbitm...@googlegroups.com
> "PRECONDITION_FAILED - inequivalent arg 'durable' for queue 'hello' in vhost '/': received 'false' but current is 'true'"

is the line you are looking for. Take a look at the property equivalence section in http://www.rabbitmq.com/queues.html. You modifies
your example after running it once and thus having a queue declared with a different "durable" property value.

Deleting the queue and re-runing the script is the right thing to do in development. Modifying the code is another option.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

duricu vlad

unread,
Apr 13, 2018, 9:56:08 AM4/13/18
to rabbitm...@googlegroups.com
Hey, it seems to work if I delete the queue. I want to make the following test: to start the receiver from spring-amqp, and the sender from python, but when I run the python script for sending the message it gave me the same error. Should I modify the channel.queue_declare(queue='hello'or should I connect to the queue, because I am new to these. The python script I would like it to run on a raspberry pi and send data to the server witch is spring-boot .



To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

--
You received this message because you are subscribed to a topic in the Google Groups "rabbitmq-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rabbitmq-users/eLwuOZ6ugvA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages