JBoR: Will it cluster?

JBoss on Rails will indeed cluster!

After modifying and dropping my jboss-rails.deployer into an ‘all’ configured server of JBoss AS 5, and firing up 3 instances on my localhost (non-trivial on OSX…):

10:43:28,409 INFO  [RPCManagerImpl] Received new cluster view: [|2] [,,]
10:43:28,435 INFO  [RPCManagerImpl] Cache local address is
10:43:28,469 INFO  [ComponentRegistry] JBoss Cache version: JBossCache 'Poblano' 2.2.0.GA

And I’ve got 3 nodes running the same Rails app, all sharing a cookie and a JBossCache cache. Nick Sieger’s JRuby-Rack handles binding the Rails session to the actual servlet session, and JBossCache takes care of the rest.

A little 8-line perl round-robinning load-balancer is wired up through mod_rewrite in my Apache httpd.conf to throw requests to each of the nodes. Anything set in the session is immediately available at the next request which lands at a different node.

Further down the line, we can look at a clustered cache for caching AR models and view fragments. Not too shabby.

It should be fairly easy to create a nice Amazon EC2 AMI with Fedora+AS5+jboss-rails, plus some better Rake/capistrano tasks, and make for quick cluster deployment.   Any EC2 experts wanting to jump in?


anjan bacchu, 06:30pm UTC, 29 September 2008

hi there,

I see that in a subsequent post you talk about doing this in OS X. Some(many) of your JBoss readers are likely to be coming from Windows. Can you write a post for Windows users so that they can do the same with Apache for doing the load balancing ?

thank you,



Bob McWhirter, 07:55pm UTC, 29 September 2008


I’m going to have to count on the community to think about the Windows side of things. I’m completely ignorant of that side of the world, and I’m purely Unix-flavored.

joshua, 12:39am UTC, 30 September 2008

hi bob,

will it actually be RoR on JBoss or JBoss on RoR. I’m kinda confused here. Anyway it would be great to have RoR running on JBoss though. Can’t wait for this project you’re doing.

Bob McWhirter, 02:09am UTC, 30 September 2008


Yah, naming is always hard, particularly when doing integration projects. Officially, it’s the hyphenated name of “jboss-rails” for the actual deployer. This follows the normal/boring JBoss-Foo naming scheme.

I’m toying with some fanciful names with personality, but we’ll see what shakes out.

The code’s available on GitHub already, if’n you’re brave to try the untried and test the untested.

mr_p, 12:01pm UTC, 04 February 2009

Good stuff! Can't wait for stable jboss-rails and Rails 3.

Login to avoid moderation.

Sign up if you need an account.

Creative Commons License Copyright 2008. Odd Thesis by Bob McWhirter is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.