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
17
votes
2 answers

RabbitMQ closes connection when processing long running tasks and timeout settings produce errors

I am using a RabbitMQ producer to send long running tasks (30 mins+) to a consumer. The problem is that the consumer is still working on a task when the connection to the server is closed and the unacknowledged task is requeued. From researching I…
Greg
  • 8,175
  • 16
  • 72
  • 125
11
votes
1 answer

Sending RabbitMQ messages via websockets

Looking for some code samples to solve this problem :- Would like to write some code (Python or Javascript) that would act as a subscriber to a RabbitMQ queue so that on receiving a message it would broadcast the message via websockets to any…
bzo
  • 1,532
  • 7
  • 27
  • 40
10
votes
1 answer

RabbitMQ def callback(ch, method, properties, body)

Just want to know the meaning of the parameters in worker.py file: def callback(ch, method, properties, body): print " [x] Received %r" % (body,) What do ch, method, and properties mean?
shashank
  • 1,133
  • 2
  • 10
  • 24
8
votes
2 answers

RabbitMQ pika.exceptions.ConnectionClosed (-1, "error(104, 'Connection reset by peer')")

I have a task queue in RabbitMQ with multiple producers (12) and one consumer for heavy tasks in a webapp. When I run the consumer it starts dequeuing some of the messages before crashing with this error: Traceback (most recent call last): File…
user3753792
  • 83
  • 1
  • 1
  • 4
6
votes
0 answers

RabbitMq Pika ConnectionResetError on _AsyncBaseTransport._consume()

Observing below error in flask app using pika for rabbitmq, using pika version 1.1.0 rabbitmq version 3.8.5 Note: Heartbeat value configured is 900 (Higher value set because of long running operation, so i've to keep the connection alive between…
5
votes
1 answer

pika `pop from an empty queue`

I'm using pika in a kubernetes cluster and consuming messages from a queue, which triggers initiating a function in a new thread. However RabbitMQ seems crash, these are the best logs I've found so far: 2020-12-23 10:39:10,906] WARNING - WRITE…
Simen Russnes
  • 2,002
  • 2
  • 26
  • 56
5
votes
3 answers

RabbitMQ Pika connection reset , (-1, ConnectionResetError(104, 'Connection reset by peer'))

searched through stackoverflow and posting this question because no solution worked for me and my question might be different from other question. I am writing a script which gets an article from rabbitMQ queue and process the article to count words…
irum zahra
  • 417
  • 1
  • 8
  • 17
5
votes
6 answers

python no module name pika when importing pika

I installed pika for python running on a mac sudo pip install pika==0.9.8 I make sure is installed, this is the response when trying to reinstall, Requirement already satisfied (use --upgrade to upgrade): pika==0.9.8 in…
manuelBetancurt
  • 15,428
  • 33
  • 118
  • 216
5
votes
2 answers

Pika blocking_connection.py random timeout connecting to RabbitMQ

i have a rabbit mq running on machine both client and rabbitMQ are running on the same network rabbitMQ has many clients i can ping client from rabbitMQ and back longest latency measured between the machine is 12.1 ms network details : Standard…
Nimrod007
  • 9,825
  • 8
  • 48
  • 71
3
votes
1 answer

Connect to RabbitMQ instance remotely (created on AWS)

I'm having trouble connecting to a RabbitMQ instance (it's my first time doing so). I've spun one up on AWS, and been given access to an admin panel which I'm able to access. I'm trying to connect to the RabbitMQ server in python/pika with the…
mcatoen
  • 111
  • 1
  • 6
3
votes
1 answer

pika, rabbitmq - get all messages from the queue without consuming them

Using the pika client, I want to display all the messages currently in the queue, without consuming them. Just to know how busy is the queue and display the jobs. So far, I can only read one message as it…
user3599803
  • 6,435
  • 17
  • 69
  • 130
3
votes
1 answer

Can a Pika RabbitMQ client service both consume and publish messages?

Could someone with Pika experience give me a quick yes/no response as to whether the following functionality is possible, or whether my thinking that it is indicates a lack of conceptual understanding of Pika. My desired functionality: Python…
Xavier Taylor
  • 1,413
  • 2
  • 10
  • 11
3
votes
2 answers

Multiple consumer in rabbitmq for multiple queue

I have 2 queues, say q1 and q2, which corresponds to e1 and e2 exchanges with binding key b1 and b2. I want to run consumer functions in parallel, say c1 and c2 which will listen to q1 and q2 respectively. I tried the following way: def c1(): …
Anirban B
  • 507
  • 8
  • 27
3
votes
1 answer

Twisted and Pika - How to add callback to a message ack call?

I'm using pika's twisted protocol adapter. When I have have successfully handled the message I send an acknowledgement to RabbitMQ using this call: channel.basic_ack(delivery_tag=delivery_tag) The basic_ack call seems to be firing asynchronously…
user404345
3
votes
1 answer

RabbitMQ python library check status

Folks, I am trying to check connections that error out, and log to alert if that happens. credentials = pika.PlainCredentials(username, password) parameters = pika.ConnectionParameters( credentials=credentials, host='localhost', …
Cmag
  • 14,946
  • 25
  • 89
  • 140
1
2 3 4 5 6