You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, we use bundle of gunicorn+django+dramatiq+gevent and rabbitmq as message broker. Gunicorn gevent worker class creates new greenlet for each new request. Dramatiq creates an amqp connection first time as it needs to send message. But after request is processed amqp connection remains opened and this connection will be not used again. Of course connection will be closed by rabbit. But it's not good and takes some time and resources. I've solved this issue with django middleware (i can create PR). Maybe is there some better solution ?
@horpto
Can you post an example with implementation? Will adding this middleware to the end of the chain for DRAMATIQ_BROKER -> MIDDLEWARE solve the connection issue?
Hey @horpto ! Thanks for providing a solution to this issue. I think the middleware solution is sufficient for now. The other option is to hardcode a conditional into the codebase. But seeing that the use case for this is quite specific with the usage of gevent, I dont think its worth adding to the codebase.
Hello, we use bundle of gunicorn+django+dramatiq+gevent and rabbitmq as message broker. Gunicorn
gevent
worker class creates new greenlet for each new request. Dramatiq creates an amqp connection first time as it needs to send message. But after request is processed amqp connection remains opened and this connection will be not used again. Of course connection will be closed by rabbit. But it's not good and takes some time and resources. I've solved this issue with django middleware (i can create PR). Maybe is there some better solution ?The text was updated successfully, but these errors were encountered: