Placing stomp.py consumer/producer inside Flask-Gunicorn python application

299 Views Asked by At

I have an existing flask application (having a bunch of REST apis) which is hosted by Gunicorn. I also have to send and receive messages from AmazonMQ in the same application. I have functions using stomp.py to send/receive messages from AmazonMQ, but I am not sure where to place them, or how should I use them so as to keep existing flow intact

1

There are 1 best solutions below

0
On BEST ANSWER

Hey thanks for help @AKX, I resolved the issue by triggering the whole process of messaging (Creation of connection, subscription to channel etc) by a method call from on_starting(server) method in gunicorn_config.py