690
questions
0
votes
0
answers
34
views
How Can I Connect to a Kubernetes RabbitMQ Cluster Using a Pika Connection in Python?
I am trying to establish a connection to my RabbitMQ Cluster running in a Kubernetes Service using a Pika connection in Python.
I've successfully created my RabbitMQ cluster by running kubectl apply -...
0
votes
0
answers
19
views
How to pass connection url to celery task?
I've got this config for celery app:
from __future__ import absolute_import, unicode_literals
from datetime import timedelta
from celery import Celery
from celery.schedules import crontab
from django....
0
votes
0
answers
10
views
Errno 98 Address already in use
I have a class that creates a connection to RabbitMQ and has a method that contains the below code.
I pull 5 million records from a database and iterates them in a loop calling the below code to push ...
1
vote
0
answers
54
views
RabbitMQ/Pika: Stream connection lost: ConnectionResetError(104, "Connection reset by peer")
Below is my rabbitmq snippet. I am running long running task, connection is getting closed though my task continue to run in the background. Once the task is complete and I am trying to acknowledge ...
0
votes
0
answers
23
views
Decide which consumer get the message from Queue
i have Queue that has 3 consumers each consumer should consume type of message based on binding keys(which are 3 and all of them binded the that queue) i want to decide which consumer consume the ...
0
votes
1
answer
84
views
aio_pika and rabbitMQ : message get treated but never gets published
Using rabbitMQ 3.12, python 3.8 and aio_pika 9.4.0, I have an architecture consisting of 9 different microservices that treat text. Each is in its own Docker container. Text is input in the main ...
0
votes
0
answers
44
views
Why I got UNKNOW status when using grpc and pika(python client of rabbitmq)?
I combined grpc and pika in a Class but I got problem both in client and server of my system when a grpc function in client get start.
The client got grpc Exception calling application, the server got ...
0
votes
1
answer
39
views
What is the function of the 'await' keywords when no asyncio.gather(), asyncio.create_task(), etc. is (visibly) used?
I am trying to create a RabbitMQ client based on aio-pika, as I need to handle messages asynchronously. This is the quick start code for asynchronous message handling: (see original code on the aio-...
0
votes
0
answers
25
views
Pika function is not beign called inside Celery delayed task
I'm trying to run a rabbitmq message from inside a celery task. I'm trying to notify another service that the task finished. The weird thing is that if I deactivate .delay() it works perfectly. But, ...
0
votes
0
answers
33
views
RuntimeError: This event loop is already running when using AsyncioConnection
With the following code I am trying to connect to my Rabbit instance using the pika AsyncioConnection adapter
import asyncio
import pika
from pika.adapters.asyncio_connection import AsyncioConnection
...
0
votes
0
answers
6
views
Import Queue parameters into python file rabbitmq?
I have 3 consumers that connect with the broker. How can I import a external config file which contains the queue parameters so that I dont have to re-write them in all the python files.
Thanks,
Dhruv
0
votes
0
answers
21
views
Unable to get the on delivery confirmation from the broker using publish confirm
import pika
import pika.exceptions
from pika import spec, DeliveryMode
connection = pika.BlockingConnection()
channel = connection.channel()
channel.queue_declare(queue= "test", durable=...
-1
votes
2
answers
71
views
Python 3: TypeError: Can't instantiate abstract class BaseConnection with abstract method create_connection
I am upgrading some very old Python code from Python 2 to Python 3. There is a simple method to check rabbitmq connection using Pika.
from contextlib import closing
from pika import ...
0
votes
0
answers
56
views
Something wrong with pika/rabbitmq arguments? (Error while passing arguments in pika)
I'm trying to use pika and rabbitmq to test dead letter exchange, but this keeps happening:
pika.exceptions.ChannelClosedByBroker: (406, "PRECONDITION_FAILED - inequivalent arg 'x-message-ttl' ...
0
votes
0
answers
32
views
Unable to connect to rmq hosted on openshift from my local machine
I'm trying to connect to rabbitMQ hosted/installed/deployed on openshift container from my local machine, and i'm facing issues.
connection = pika.BlockingConnection(pika.ConnectionParameters(...
0
votes
0
answers
79
views
How to remove an inactive consumer from rabbitmq queue?
I have a simple setup where a message is sent to a queue via an exchange and the consumer binds to it and receives the message for further processing.
The problem is whenever I forcefully stop the ...
0
votes
0
answers
27
views
Perform Action after prefetch processing is complete
I have a script consuming a queue on RabbitMQ and writing it to Postgresql
I am prefetching a 1000 records and writing them, but the only way to commit the data is to run a commit in the callback ...
0
votes
0
answers
17
views
Is it possible to perform an action at the end of a consumption cycle?
In a test, I am consuming messages with prefetch and manual ack using callback where I am also performing a database write with a cursor. However, I have to commit after each call. Is there a way for ...
0
votes
0
answers
48
views
How can I set TTL for a RabbitMQ queue from MATLAB?
I have been trying to get this to work but I am stuck. I have two systems and one runs python in which I declare the queue as following:
channel_task = pika.BlockingConnection(pika....
0
votes
0
answers
81
views
is ConnectionClosedByClient exception from pika a problem
I recently upgraded to a newer version of pika and these logs started showing up where they have not been there before:
User-initiated close: result=BlockingConnection__OnClosedArgs(connection=<...
0
votes
0
answers
21
views
How to consume messages from RBMQ queue using b-rabbit library
I am trying to consume RBMQ messages.
Actually I was using pika library but it is not thread safe.
So I am going to use b-rabbit library.
But in the library doc, it is mentioned about only publishing ...
1
vote
1
answer
82
views
Synchronous call using python pika with RabbitMQ
I'm new to RabbitMQ and am trying to use the pika library to get messages. I can get this to work with basic_consume() but I want to use basic_get() instead because this will be running in an AWS ...
0
votes
0
answers
54
views
Django + RabbitMQ multiple Tabs
In my project, I'm using pika/RabbitMQ to send a SQL script from my web page to a remote database. This database processes and returns the conclusion. My problem is that I want to give my users the ...
0
votes
1
answer
460
views
RabbitMQ and GCP Pub/Sub integration
I am working on integration RabbitMQ and GCP Pub/Sub.
I am using Pika library with Python. Connection is established by BlockingConnection.
My consumer is running as separate thread. Max expected ...
0
votes
0
answers
117
views
no analogue for pika.SSLOptions in aio_pika
I want to move from pika to aio-pika. So, my project uses ssl and I specify ssl-related settings in pika.SSlOptions class. Firstly I create ssl.SSLContext instance and specify CA, certfile, keyfile ...
0
votes
1
answer
120
views
Python custom logging handler tries to log itself during emit()
I am trying to implement a custom logging handler, which should post to a rabbitmq server1.
A basic setup of this would look something like this:
class RabbitMQHandler(logging.Handler):
def ...
0
votes
0
answers
65
views
is there a way to prevent my FastApi server from stopping as a result of my rabbitmq listening to incoming messages using pika client?
My FastApi server calls a function called consume_messges(), the consume_messages() is a function that creates a pika connection and startsconsuming for incoming message
the function is called ...
0
votes
0
answers
85
views
Is there any way to use custom Consumer Tag with pika
I am using pika to work with RabbitMQ. I have a queue with a dozen consumers. I want to map consumer information in Rabbit with my application logs. So is there any way of either getting the attached ...
1
vote
0
answers
172
views
Handling long running Tasks in Pika/RabbitMQ Threaded Consumers for enabled client heartbeat
I am running threaded consumers (~20 to 30 threads - configurable) on my server for concurrent message processing. My consumers are daemonized so that I can use a CLI like utility to start and stop ...
1
vote
1
answer
134
views
Durable queues do not survive container stop
I have the following setup:
version: '3.8'
services:
rabbitmq:
image: rabbitmq:3-management
container_name: 'rabbitmq'
volumes:
- ./rabbitmq.conf:/etc/rabbitmq/...
1
vote
1
answer
1k
views
Ensuring that aio_pika consumer runs forever alongside FastAPI
I wrote a aio_pika consumer task that is supposed to run forever in a FastAPI app. This task is part of a manager object which implement a pub/sub pattern:
from aio_pika import connect_robust
from ...
0
votes
1
answer
363
views
send 1 million messages to queue in 1 minutes
I am using rabbitMQ to receive the message.
I have 1,000,000 messages need to send out in 1 minute to queue. I am using multiprocessing by python.My code can send over 5 minute. Is that possible to ...
1
vote
0
answers
53
views
How can I avoid a RabbitMQ producer disconnection?
I am trying to set up a simple message producer along with its consumer using RabbitMQ in python with the pika library.
Whenever my producer stays idle for too long, the connection closes and I get an ...
1
vote
0
answers
459
views
How do I run the rabbit MQ consumption on another thread?
I want to be able to use the RabbitMQ consumer to listen for new messages but the thread is blocking and the application does not start up. What's the best approach to handling the listening handler ...
0
votes
1
answer
74
views
when retrive result of a task with "reply_to" it result tuple. and says " Received and deleted unknown message. Wrong destination?!?"
i am using celery and RabbitMq
create a simple task and send results of the task to the "result" queue
when i connect to this que to processing on the result of the task it say " ...
1
vote
0
answers
416
views
Pika ConnectionResetError(104, 'Connection reset by peer') having 2 connections using threads
I am running into the following error with pika
pika.exceptions.StreamLostError: Stream connection lost: ConnectionResetError(104, 'Connection reset by peer')
I've read on stackoverflow and other ...
0
votes
1
answer
828
views
pika.exceptions.AMQPConnectionError in Python pod when trying to connect to RabbitMQ in Kubernetes
In Kubernetes I have deployed RabbitMQ pod, service and ingress.
I have access to RabbitMQ UI and I added a user that has access to virtual host "/" and a password.
I tried to create a ...
0
votes
2
answers
914
views
Can't connect to rabbitmq - ACCESS_REFUSED
everyone!
I want to connect to rabbitmq with aio_pika using an admin level login and password.
async def send_rmq(message) -> None:
connection = await connect("amqp://login:password@url&...
0
votes
1
answer
262
views
Sharing Pika Connection Singleton Object between gunicron workers on django application
I am trying to connect to email queue from django application. I have created an EmailPublisher which will be a singleton object which extends RabbitMQProducer object which has actual code of ...
1
vote
1
answer
127
views
pike.exception.StreamLostError python pika rabbitmq
I get pike.exception.StreamLostError: Stream connection lost: connectionResetError(10054... when I call connection.channel():
p = pika.ConnectionParameters('localhost')
c = pika.BlockingConnection(p)
...
0
votes
0
answers
242
views
How run pika consumer and publisher in two threads?
I use library pika 1.3.2 and threading.
I want run one connection with two channels: to consumer and to publisher.
I run two threads, and all Ok.
But how can I stop consumer and close channels and ...
0
votes
1
answer
805
views
Executing celery task through a listener on a RabbitMQ queue
I am trying to run a script for a messaging consumer that listens to a rabbitMQ instance and executes a celery job based on that message value. I am receiving issues with circular dependencies and ...
1
vote
0
answers
1k
views
pika.exceptions.StreamLostError: Stream connection lost: ConnectionResetError(104, 'Connection reset by peer')
I use pika basic_get method to get message from rabbitmq and basic_ack method to do ack.
import pika
connection = pika.BlockingConnection(
pika.ConnectionParameters(
host="rabbitmq&...
1
vote
1
answer
964
views
Pika RabbitMQ Error: Stream connection lost: ConnectionResetError(10054, 'An existing connection was forcibly closed by a remote host' )
I am trying to run a worker model where I have single program sender.py that sends youtube urls and an index into a queue called the process_queue. Then I have defined a worker program called reciever....
0
votes
1
answer
270
views
Modify and re-queue a message using pika on python
I'm using Pika/RabbitMQ lib for processing messages in a python 3.8 project. When processing the messages the function can fail due to several reasons. There are a few cases when the message can be ...
0
votes
1
answer
93
views
Pika example https://github.com/pika/pika/blob/main/examples/basic_consumer_threaded.py
I have read some post in this group and I don’t understand what is the point of using:
https://github.com/pika/pika/blob/main/examples/basic_consumer_threaded.py
I mean, why we need one additional ...
1
vote
0
answers
395
views
Why do Consumers disconnect from the queue silently during long idles using Pika RabbitMQ?
In my company we are currently facing a strange behavour using rabbitMQ. One of our microservices hosted in a Kubernetes Cluster is built in Python (the others in Java and they don't show this problem)...
0
votes
1
answer
106
views
stomp.js cannot receive message sent from pika (RabbitMQ version: 3.11.7)
I have a web page that should receive messages from RabbitMQ using STOMP:
<body>
<script src="stomp.js"></script>
<script src="https://cdn.jsdelivr.net/npm/...
0
votes
0
answers
90
views
How to make timeout callback funtion in rabbit ioloop
I need to make a function to be executed every n seconds. I have found a call_later method, but the problem is it executes only once:
self._connection.ioloop.call_later(self.timeout, self.callback)
...
0
votes
0
answers
124
views
unable to connect django sevice with rabbitmq service using docker
I am trying to connect RabbitMQ with Django application. But when I run the command "docker-compose up" I get this error "pika.exceptions.AMQPConnectionError" can someone explain ...