AjaxMessaging - bring realtime messaing to Ruby on Rails

介绍了一个为Ruby on Rails提供实时消息传递的插件AjaxMessaging。该插件通过STOMP协议连接到消息中间件如ActiveMQ,并将消息实时推送到客户端。

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:
    script/plugin install http://ajaxmessaging.googlecode.com/svn/trunk/plugins/ajaxmessaging
Edit config file:
    config/mongrel_conf.yml
Start your MOM server. If you are using ActiveMQ, go to AMQ directory and enter following command:
    ./bin/activemq  
Start rails by enter following command:
    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

 ajax-rails2.png

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值