`
siuying
  • 浏览: 90863 次
  • 性别: Icon_minigender_1
  • 来自: 香港
最近访客 更多访客>>
社区版块
存档分类
最新评论

AjaxMessaging - bring realtime messaing to Ruby on Rails

    博客分类:
  • Tech
阅读更多

Proudly present my new plugins for Ruby on Rails! This is based on my previous post on Juggernaut and ActiveMQ Ajax Web Demo. ( More details include tutorial coming! Meanwhile, please try the example ;-) )

DESCRIPTION

AjaxMessaging, or a11g, is a plugin to provide real time messaging for Ruby on Rails.

ABOUT

DETAILS

Using AjaxMessaging, Rails view can receive real time update from back-end Messaging Oriented Middleware (MOM).

What Happens:

  1. Client open a AJAX connection to Rails
  2. Rails connect to MOM using STOMP, listening for specific channels, if there are incoming messages, they are sent to client.
  3. If no message for a short period (~30s), the ajax connection return and client try again.

Features:

  1. Message sent to client at realtime
  2. Only regular HTTP connection is required. No socket server, no hacks on HTTP Pushing. Therefore, most firewall and browser supports it.
  3. Subscription to multiple channels. Message can sent to either user or channels.
  4. Integrated plugin, simple helper functions.

Requirements:

  1. Rails 1.2+
  2. json gem (gem install json)
  3. stomp gem (gem install stomp)
  4. Mongrel (gem install mongrel), you must use mongrel as web server as AjaxMessaging use Mongrel custom HttpHandler
  5. MOM supports STOMP, e.g. ActiveMQ

INSTALLATION

  1. Enter following command in your project:
  2.     script/plugin install http://ajaxmessaging.googlecode.com/svn/trunk/plugins/ajaxmessaging
  3. Edit config file:
  4.     config/mongrel_conf.yml
  5. Start your MOM server. If you are using ActiveMQ, go to AMQ directory and enter following command:
  6.     ./bin/activemq  
  7. Start rails by enter following command:
  8.     mongrel_rails start -C config/mongrel_conf.yml

EXAMPLES

You may get an example project at:

   svn checkout http://ajaxmessaging.googlecode.com/svn/trunk/examples/ajaxmessaging-examples ajaxmessaging-examples

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics