Questions tagged [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.

672 questions
17
votes
4 answers

Python and RabbitMQ - Best way to listen to consume events from multiple channels?

I have two, separate RabbitMQ instances. I'm trying to find the best way to listen to events from both. For example, I can consume events on one with the following: credentials = pika.PlainCredentials(user, pass) connection =…
blindsnowmobile
  • 3,868
  • 6
  • 32
  • 47
15
votes
2 answers

SparkStreaming, RabbitMQ and MQTT in python using pika

Just to make things tricky, I'd like to consume messages from the rabbitMQ queue. Now I know there is a plugin for MQTT on rabbit (https://www.rabbitmq.com/mqtt.html). However I cannot seem to make an example work where Spark consumes a message…
disruptive
  • 5,687
  • 15
  • 71
  • 135
15
votes
2 answers

No handlers could be found for logger "pika.adapters.blocking_connection"

Similar questions all seem to be based around using a custom logger, I'm happy to just use the default / none at all. My pika python app runs and receives messages but after a few seconds crashes with No handlers could be found for logger…
Mim Hufford
  • 609
  • 8
  • 16
14
votes
1 answer

Block jupyter notebook cell execution till specific message received

I'm trying to implement asynchronous, distributed computation engine for python, which is compatible with jupyter notebook. The system is supposed to be based on 'push notification' approach what makes it (almost, I hope) impossible to allows user…
14
votes
2 answers

How to connect pika to rabbitMQ remote server? (python, pika)

In my local machine I can have: connection = pika.BlockingConnection(pika.ConnectionParameters('localhost')) for both scripts (send.py and recv.py) in order to establish proper communication, but what about to establish communication from…
Eriel Marimon
  • 175
  • 1
  • 2
  • 9
13
votes
2 answers

In Pika or RabbitMQ, How do I check if any consumers are currently consuming?

I would like to check if a Consumer/Worker is present to consume a Message I am about to send. If there isn't any Worker, I would start some workers (both consumers and publishers are on a single machine) and then go about publishing Messages. If…
Optimus
  • 2,716
  • 4
  • 29
  • 49
12
votes
6 answers

Program Running Pika Throwing AMQPConnectionError

Going through the Rabbit MQ Pika HelloWorld tutorial found here: https://www.rabbitmq.com/tutorials/tutorial-one-python.html The problem is, I keep getting this error whenever I run my receive script: Traceback (most recent call last): File…
Colin Warn
  • 371
  • 1
  • 3
  • 19
12
votes
3 answers

How to add a header key:value pair when publishing a message with pika

I am writing an automated test to test a consumer. So far I did not need to include a header when publishing messages but now I do. And it seems like its lacking documentation. This is my publisher: class RMQProducer(object): def __init__(self,…
raitisd
  • 3,875
  • 5
  • 26
  • 37
12
votes
1 answer

rabbitmq multiple consumers on a queue- only one get the message

I implemented multiple consumers, who are fetching messages from a single queue, I am doing this using something similar to this example, except that I'm doing basic.get on an infinite loop for polling. Any idea how do I prevent racing between all…
JavaSa
  • 5,813
  • 16
  • 71
  • 121
12
votes
2 answers

pika, stop_consuming does not work

I'm new to rabbitmq and pika, and is having trouble with stopping consuming. channel and queue setting: connection = pika.BlockingConnection(pika.ConnectionParameters('localhost')) channel =…
laike9m
  • 18,344
  • 20
  • 107
  • 140
11
votes
2 answers

Leading b in python pika response

I am trying to make a simple AMQP client using python. I copied the code I found in RabbitMQ website: #!/usr/bin/env python import pika connection = pika.BlockingConnection(pika.ConnectionParameters( host='localhost')) channel =…
Kamrul Khan
  • 3,260
  • 4
  • 32
  • 59
11
votes
1 answer

how to get basicproperties header field in pika python from rabbitmq messages?

def callback(ch, method, properties, body): prop = properties print prop #print prop[1] #print prop[“headers”] #print prop.headers() print body This is the list from…
suhprano
  • 1,723
  • 1
  • 16
  • 22
10
votes
0 answers

Message sequence acting unexpectedly in RabbitMQ

I'd like to implement a RabbitMQ topology similar to Option 3 here, except for some differences: The new topology should handle a few 1000 messages per day. And it shall have two exchanges: one to deal with the main queues (about 30), the other to…
pymat
  • 1,090
  • 1
  • 23
  • 45
10
votes
2 answers

RabbitMQ Error 530 vhost not found with pika

I am trying to connect to a remote rabbitmq server. I have the correct credentials and vhost exists on the remove server, but I cannot connect. I get the error pika.exceptions.ProbableAccessDeniedError: (530, 'NOT_ALLOWED - vhost test_vhost not…
Iruku Kagika
  • 583
  • 1
  • 7
  • 17
10
votes
1 answer

IncompatibleProtocolError while trying to connect to RabbitMQ

I've got a problem with connecting from Python code using pika to dockerized RabbitMQ. I'm using this code to connect to the queue: @retry(wait_exponential_multiplier=1000, wait_exponential_max=10000, stop_max_attempt_number=2) def…
bartekmp
  • 403
  • 3
  • 9
  • 21
1
2
3
44 45