Integrating Orbited with Web App Frameworks
September 7th, 2008 by Adrian WeisbergThe simplest Orbited architecture is to have Orbited proxying messages between the TCP server and the browser using socket connections. Many people, however, choose to use web application frameworks like Django or Ruby on Rails because they helpfully abstract away certain cumbersome tasks. You can easily connect Orbited and frameworks using message queue brokers, and the 0.7 release will feature an integrated basic broker.
Prior to 0.5, Orbited used a custom protocol (the Orbit protocol) for communication between it and the framework. Inside Orbited was a rudimentary message queue. This is the method used in the outdated CherryChat tutorial.
Use Existing Solutions
With 0.5, the team decided to switch to a standard and well-developed protocol: STOMP. Instead of trying to improve the message queue functionality, we decided to focus on TCPSocket and Comet. Using STOMP allows the use of advanced stand-alone message queue brokers like ActiveMQ and RabbitMQ. It also removes the need to write and update clients for the custom Orbit protocol, since there are actively maintained STOMP clients in many languages. These benefits are similar to the benefits of the biggest change in 0.5: TCPSocket, which lets you use existing protocols for communication to the browser.
The Super-Easy Way
ActiveMQ and RabbitMQ are fairly easy to install and use, but many people wanted something even easier and simpler for testing and basic deployments. Starting with 0.7, Orbited will feature a built-in basic STOMP message queue. The message queue has already been released as a Twisted-based daemon called Morbid. If you have setuptools installed, type easy_install morbid and then run orbited and morbid. Go into the Stomp demo and it should work! Once Orbited 0.7 is released you won’t even have to install Morbid.
The Benefits in Two Sentences
With the integrated STOMP message queue, you can use the same architecture as with pre-0.5 but with the added benefits of using a standard protocol. Using a stand-alone STOMP message queue broker gives you the benefits of the standard protocol plus the features and performance of advanced message queue brokers.




September 12th, 2008 at 10:59 pm
Thanks for the confirmation.
On Twitter someone brought up Comet/Orbited. I admitted harkening back to Netscape’s efforts with push (’97? ‘98?) and suggested to him that cough it calls for more design than most folk can manage.
I tried the chat. Demo? With a right side-bar full of names that serves to list and nothing else? passive? un-linked? sterile? fallow? (What was I saying about design? I must have been ranting.)
And the first thing I read when I come to the blog:
I say tomato, you say Ruby … I say potato, someone sez .NET.
Meh … while editing hurricane wiki links I came up with the notion for a QRSS digital mode for ham radio. That sounds like fun. This sounds like self-inflicted injury.
May God have mercy on your soulsMay you encounter happiness free from the root of suffering.-VA- –bentrem
September 22nd, 2008 at 1:05 pm
Hi,
It seems that ActiveMQ is not well suited to handle thousands of consumers at the same time. Do you recommend anything until 0.7 is released? (my needs are very simple: just a “activity” notification will be done thru “comet” - no persistence of message) However, we need to handle thousands of connexions established simultaneously (5k - 10k).
Thanks!
September 22nd, 2008 at 8:36 pm
Fraggle: Try RabbitMQ (http://www.rabbitmq.com/). Also, you said “until 0.7 is released,” so be aware that Morbid (the MQ that will be integrated into Orbited in 0.7) isn’t scalable and was built for development and small deployments. The demands you’re talking require a more high-performance solution like RabbitMQ. Let us know how it works out.
September 24th, 2008 at 6:12 am
[...] Weisberg recently wrote about various patterns of integrating Orbited and a web framework. We’ve been doing a lot of work to move towards direct integration with message queues as the [...]
September 26th, 2008 at 8:13 am
[...] that this uses a different technique than the STOMP method I described. Dark Porter takes advantage of the fact that Django and Orbited are both written in [...]
September 26th, 2008 at 11:53 am
[...] Weisberg on the “Orbited” blog wrote about Orbited integration with web frameworks. Orbited in its forthcoming 0.7 version will smoothly integrate with web frameworks using message [...]
November 5th, 2008 at 7:06 pm
I just keep shaking my head in amazement with every new thing I learn about Orbited.
I tried this in built STOMP thingy with Orbited 0.7.0 and I am truly blown away. Absolutely fantastic.