My web application should be able to send XMPP (Facebook Chat) messages, and I thought celery might be a good solution for this. The challenge is to query the database and send an XMPP message to multiple users. However, with this approach, I had to connect to the XMPP server every time I run the task, which is not a great idea.
From the Facebook API API :
Best practics
- Your Facebook Chat integration should only be used for sessions that are expected to be durable. Customers should not quickly select and disconnect.
Is there a way to share an XMPP connection between workers, so I donβt need to reconnect every time I want to send a message? Or is there a better solution?
Iley watkins
source share