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
3
votes
0 answers

How to create new channel from single connection (pika/rabbitmq)?

I'm writing some python code using pika 0.9.13 to connect to RabbitMQ. I'm creating lots of child processes (potentially 1000s) and want each process to be able to send to RabbitMQ. Reading around, it seems the best way is to create a single…
bzo
  • 1,532
  • 7
  • 27
  • 40
3
votes
2 answers

Get total number of consumers for a RabbitMQ queue using pika

The following code is what I use to get a count of number of consumers : import pika connection = pika.BlockingConnection(pika.ConnectionParameters(host='IP ADDRESS')) channel =…
Krsrb1
  • 95
  • 1
  • 7
2
votes
0 answers

How to verify that Pika is working asynchronously?

A characteristic of an asynchronous behaviour is that it doesn't wait on the handling of the current request to be completed before attending to the next one. In my recent exploration with Pika + RabbitMQ, I wanted to verify the above by using the…
Jack Oat
  • 33
  • 2
2
votes
0 answers

How to create all users with permission in rabbitmq using pika client methods in python

I have a requirement to create users with different permissions in rabbitmq using pika client methods in python. Any documentation will help. What are the supporting methods in pika client for doing the same.
Lucifer007
  • 107
  • 1
  • 14
2
votes
1 answer

connection_workflow.AMQPConnectorStackTimeout from BlockingConnection

A pika BlockingConnection attempt failed (pika version 1.0.0). The exception shown in the application log - adapters.utils.connection_workflow.AMQPConnectorStackTimeout - doesn't appear to be any of the exceptions in pika.exceptions. Isn't pika…
Ian Goldby
  • 5,609
  • 1
  • 45
  • 81
2
votes
1 answer

Accessing a specific certificate from the windows store with python

I am trying to connect to RabbitMQ using Pika. We are using certificates (ssl) to do this. Here is their (Pika's) example: context = ssl.create_default_context( …
TheLettuceMaster
  • 15,594
  • 48
  • 153
  • 259
2
votes
3 answers

How to check if there is no message in RabbitMQ with Pika and Python

I read messages from RabbitMQ with the pika python library. Reading messages in the loop is done by connection = rpc.connect() channel = connection.channel() channel.basic_consume(rpc.consumeCallback, queue=FromQueue,…
cwhisperer
  • 1,478
  • 1
  • 32
  • 63
2
votes
1 answer

check and create amqp virtual host (vhost) in python (pika)

I am new to pika (https://github.com/pika/pika). I wonder whether there are APIs to check whether one virtual host exists or not, and whether there are APIs to create virtual host. I know that vhost can be created by rabbitmqctl, but I did not find…
BAE
  • 8,550
  • 22
  • 88
  • 171
2
votes
1 answer

Select nth to nth row while table still have values unselected with python and pyodbc

I have a table with 10,000 rows and I want to select the first 1000 rows and then select again and this time, the next set of rows, which is 1001-2001. I am using the BETWEEN clause in order to select the range of values. I can also increment the…
predator
  • 477
  • 2
  • 6
  • 22
2
votes
1 answer

Force workers to instantly pick up failed messages when persistent delivery mode is enabled

I have a RabbitMQ Server set up where I fetch messages using Python-Pika. The problem is that if I have persistent delivery mode enabled, and the workers fails to process a message. Instead of releasing the message, it will keep it until the message…
eandersson
  • 25,781
  • 8
  • 89
  • 110
1
vote
1 answer

How to run an async basic_consume in pika

I would like to run an on message callback async in a pika basic_consume. Is that possible and how? We are already running an asyncio loop for other tasks and this consumer uses httpx with an async connection to call internal services. Here is our…
muuvmuuv
  • 901
  • 2
  • 13
  • 39
1
vote
0 answers

How to reconnect rabbitMQ pika python?

is there a way to get "reconnect" to rabbitMQ if connection lost? How can I reconnect to rabbitmq? What's the best way? Is there any "strategy"?
hmn Falahi
  • 730
  • 5
  • 22
1
vote
1 answer

What is the use of add_callback_threadsafe() method in pika?

From the description in the pika documentation, I can't quite get what add_callback_threadsafe() method does. It says, "Requests a call to the given function as soon as possible in the context of this connection’s thread". Specifically, which event…
sherlock
  • 2,397
  • 3
  • 27
  • 44
1
vote
1 answer

how to publish msg to rabbitmq server with self signed certificate with python pika?

parameters = pika.URLParameters('amqps://:@/') connection = pika.BlockingConnection(parameters) channel = connection.channel() I am getting: ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify…
topcan5
  • 1,511
  • 8
  • 30
  • 54
1
vote
1 answer

Publisher waits for consuming messages while it should do both things(publishing and subscribing replies from subscriber).)

Publisher is getting blocked after after consuming 1st message_reply. It is not sending any messages to subscriber. I have already tried that if I don't use 'start_consuming()' method publisher sends data continuously but it does not print…