利用ActiveMessaging连接消息队列及嵌入C和C++代码
1. 利用ActiveMessaging连接消息队列
1.1 问题描述
公司的大部分基础设施基于异步消息传递,需要构建一个Rails应用程序,通过向公司的中央订单处理程序发送消息来下订单。订单将存储在本地数据库中,应用程序将监听订单处理程序发出的订单状态消息,以便前端提供良好的用户体验并跟踪订单的当前状态。
1.2 准备工作
- 执行相关安装步骤。
- 从Rails应用程序的根目录安装ActiveMessaging插件:
mschmidt> script/plugin install \
> http://activemessaging.googlecode.com/svn/trunk/plugins/\
> activemessaging
1.3 解决方案
1.3.1 构建订单模型
在数据库中创建订单模型:
create_table :orders do |t|
t.column :customer, :string
t.column :product, :string
t.column :quantity, :int
t.column :status, :string, :default => 'OPEN'
t.timestamps
end
<
超级会员免费看
订阅专栏 解锁全文
59

被折叠的 条评论
为什么被折叠?



