Search code examples
pythonflaskgunicornamazon-mqstomp.py

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


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


Solution

  • 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