0

I am running Django application on multiple machines say m1, m2, m3.

all of them are using centralized database hosted on my_db_host.com.

I want to notify to m2, m3 instances from m1 on particular action/activity.

I have explored crossbar.io, but could not find proper guideline to integrate this.

Please let me know what is the best approach for message passing from one app-instance to other.

Raghvendra Parashar
  • 3,883
  • 1
  • 23
  • 36
  • Have you looked at Celery? – Glyn Jackson Feb 18 '15 at 09:49
  • this is kind of "Task Queue", and I need to send message to running application instance. – Raghvendra Parashar Feb 18 '15 at 10:00
  • Aren't you describing a message queue? Take a look at [this](https://www.rabbitmq.com/tutorials/tutorial-three-python.html). Doesn't this solve your problem? – Taylan Aydinli Feb 18 '15 at 10:05
  • @rkp yep and thats what Celery and a message broker is for i.e. RabbitMQ – Glyn Jackson Feb 18 '15 at 10:29
  • @GlynJackson I want real-time update, so that other app(hosted on different machine) could reload its objects(present in memory) from database. – Raghvendra Parashar Feb 18 '15 at 14:22
  • @rkp passing messages is what a broker does! We have systems which run tasks then inform other process one action is complete to start another processing them parallel (parallel distribution). Your question seems like you need Celery Chords, Chains and Callbacks http://ask.github.io/celery/userguide/tasksets.html not Sockets. If you do need sockets start here: http://www.maxburstein.com/blog/realtime-django-using-nodejs-and-socketio/ – Glyn Jackson Feb 18 '15 at 19:32
  • Crossbar.io is a message broker that implements Publish & Subscribe, but also Routed RPC. So you can have components m2/m3 be notified from m1. The problem is: Django is a WSGI app, and WSGI is an inherently blocking API. It is hard to wait on one thing (notification from m1) while still doing useful work - on the same WSGI worker thread/process. – oberstet Feb 18 '15 at 21:30

0 Answers0