python-pika

Multiple consumer in rabbitmq for multiple queue

倖福魔咒の 提交于 2020-02-25 01:51:16
问题 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(): connection = pika.BlockingConnection(pika.ConnectionParameters(host=constants.rmqHostIp)) channel = connection.channel() channel.exchange_declare(exchange='e1', durable='true', type='topic') result = channel.queue_declare(durable='false', queue='q1')

Sending RabbitMQ messages via websockets

最后都变了- 提交于 2019-12-09 06:03:02
问题 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 connected client. I've looked at Autobahn and node.js (using "amqp" and "ws" ) but cannot get things to work as needed. Here's the server code in javascript using node.js:- var amqp = require('amqp'); var WebSocketServer = require('ws').Server var

Pika blocking_connection.py random timeout connecting to RabbitMQ

对着背影说爱祢 提交于 2019-12-01 06:39:43
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 Switch network (network of virtual machines running on single physical machine - using vmware VC) im getting random timeouts when initializing RPC connection /usr/lib/python2.6/site-packages/pika-0.9.5-py2.6.egg/pika/adapters/blocking_connection.py problem is that the timeout isn't consistent and happens from time to time. when manually testing this

Pika blocking_connection.py random timeout connecting to RabbitMQ

这一生的挚爱 提交于 2019-12-01 05:49:26
问题 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 Switch network (network of virtual machines running on single physical machine - using vmware VC) im getting random timeouts when initializing RPC connection /usr/lib/python2.6/site-packages/pika-0.9.5-py2.6.egg/pika/adapters/blocking_connection.py

python no module name pika when importing pika

微笑、不失礼 提交于 2019-11-30 18:18:47
问题 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 /usr/local/lib/python2.7/site-packages but when i import pika on a *.py I get, ImportError: No module named pika my python version python --version Python 2.7.5 how to make this module recognised by Python? thanks! edit 1 I call the import like this import pika which gives the