Questions tagged [python-pika]

Python-Pika is a pure-Python implementation of the AMQP 0-9-1 protocol that tries to stay fairly independent of the underlying network support library. Python-Pika was developed primarily for use with RabbitMQ, but should also work with other AMQP 0-9-1 brokers.

Python-Pika is a pure-Python implementation of the AMQP 0-9-1 protocol that tries to stay fairly independent of the underlying network support library. Python-Pika was developed primarily for use with RabbitMQ, but should also work with other AMQP 0-9-1 brokers.

80 questions
1
vote
1 answer

SelectConnection does not connect to rabbitmq

I am new in Python programming, so I am trying to consume two rabbitmq queues using pika, but using SelectConnection raises an exception IndexError: tuple index out of range An invalid channel number has been specified, but if I use…
Vinicius
  • 13
  • 3
1
vote
1 answer

Python Pika connection with TLSv1_2

I am using Python3.6 to get connection to RabbitMQ. This connection uses TLSv1.2 protocol. Setting the connection parameters for SSL: cxt = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) ssl_options = pika.SSLOptions(context=cxt,…
Nitin1706
  • 621
  • 1
  • 11
  • 21
1
vote
0 answers

channel.start_consuming() is not running and did not provide any exceptions

I am new to the python . I cant understand channel.start_consuming() is not working. my code def functions(host): global LOGGER global RABBITMQ_USER global RABBITMQ_PASSWORD while True: try: credentials =…
Sammu Sundar
  • 556
  • 3
  • 9
  • 24
1
vote
2 answers

Using pika, is it possible to read rabbitmq binding arguments?

Look at the following screenshot My queue has a binding with an exchange named foo only receiving messages with Routing key bar. I have also defined a pair of arguments {baz: qux}. Now I have a following code: credentials =…
mnowotka
  • 16,430
  • 18
  • 88
  • 134
1
vote
0 answers

how to shutdown pika consuming thread

kind of new to Pika, i have some code like:(not include constructor and other unrelated function here) class Consumer(object): def __disconnect(self): try: self.__channel.stop_consuming() self.__channel.close() …
1
vote
1 answer

Why is the looping call required when consuming from queue?

I am trying to consume from rabbit queues using pika and twisted: Constantly (new message -> consume) Once (new message -> consume once, don't consume again until I say so) The only input I have is this example. It covers use case 1. What about…
kev
  • 8,928
  • 14
  • 61
  • 103
1
vote
0 answers

RabbitMQ and django celery

i am using pika client for creating connection to rabbitmq for some pub-sub project. A direct call to the client work fine but when i am trying to create a channel inside a celery task i getting an error. raised unexpected: OSError(9, 'Bad file…
Sanjay Bisht
  • 86
  • 1
  • 7
1
vote
1 answer

Publish/Subscribe MQTT message over RabbitMQ using pika (python client)

I have existing RabittMQ server set-up and we enabled MQTT plug-in to publish/subscribe mqtt messages. We have pika client to process the existing queue messages . Right now , we want to use the same pika on_message() handler to process the mqtt…
JavaUser
  • 25,542
  • 46
  • 113
  • 139
1
vote
2 answers

Python get variable value outside the function in RabbitMQ

Below is the function am using to get messages from producer.py def callback(ch, method, properties, body): result = body.decode() resp = JSONEncoder().encode(result) json_resp = json.loads(resp) print(json_resp) ch.basic_ack(delivery_tag =…
deepak murthy
  • 411
  • 3
  • 6
  • 21
1
vote
1 answer

Python 3.6 : How can I create a pika consumer using SelectConnection adapter without using a class?

I am new to python and pika and I am running into problems consuming from a queue using the BlockingConnection adapter which keeps throwing an exception after a few hours. I am therefor now trying to use the SelectConnection (Asynchronous) adapter…
user5776527
1
vote
1 answer

RabbitMQ - Socket Closed Exception - Windows Server 2012

So I have a publisher which is using schedule python package to read data from a file and every 5-10 mins and publish each line to a queue. On the other side I have consumer using something like: self.connection =…
1
vote
1 answer

Pass a function (callback) variable between functions running in separate threads

I am trying to develop a Python 3.6 script which uses pika and threading modules. I have a problem which I think is caused by my A) being very new to Python and coding in general, and B) my not understanding how to pass variables between functions…
Mark Smith
  • 757
  • 2
  • 16
  • 27
1
vote
1 answer

kombu not reconnecting to RabbitMQ

I have two servers, call them A and B. B runs RabbitMQ, while A connects to RabbitMQ via Kombu. If I restart RabbitMQ on B, the kombu connection breaks, and the messages are no longer delivered. I then have to reset the process on A to re-establish…
vgoklani
  • 10,685
  • 16
  • 63
  • 101
1
vote
1 answer

pika.BlockingConnection() failing inside containers, works well within VMs

I am trying to use rabbitmq inside my container. I installed the required libraries and then tried to create a BlockingConnection, but it fails. The same thing works when I try it on any VM or physical host. It fails with containers only. Here are…
Rahul
  • 2,515
  • 3
  • 25
  • 29
1
vote
2 answers

Unable to access RabbitMQ server from other clients on the network due to authentication error

I have installed RabbitMQ on Ubuntu 14.04 and I am unable to connect to the RabbitMQ server from other computers on the network. There are no problems connecting to the server from the machine where RabbitMQ is installed, only from other computers…
Greg
  • 8,175
  • 16
  • 72
  • 125