http://www.rabbitmq.com/
http://www.rabbitmq.com/getstarted.html
http://www.rabbitmq.com/download.html
下载 Binary 包 #rabbitmq_server-2.8.5
安装erlang #略去Erlang R14B03 (erts-5.8.4)
sbin/rabbitmq-server #启动服务器
./rabbitmq-server -detached # 后台运行
./rabbitmqctl status #查看状态
./rabbitmqctl stop #停止服务
#增加 stomp支持
rabbitmq-plugins enable rabbitmq_stomp
/exchange -- SEND to arbitrary routing keys and SUBSCRIBE to arbitrary binding patterns;
/queue -- SEND and SUBSCRIBE to queues managed by the STOMP gateway;
/amq/queue -- SEND and SUBSCRIBE to queues created outside the STOMP gateway;
/topic -- SEND and SUBSCRIBE to transient and durable topics;
/temp-queue/ -- create temporary queues (in reply-to headers only).
# 默认用户guest/guest
require "stomp"
client = Stomp::Client.new("stomp://guest:guest@localhost:61613")
client.subscribe("/queue/kktest") do |msg|
p msg
end
require "stomp"
c2 = Stomp::Client.new("stomp://guest:guest@localhost:61613")
c2.publish("/queue/kktest", "hello world!")
http://www.rabbitmq.com/relocate.html #各种文件路径 文档有问题
至少配置文件是 ${install_prefix}/etc/rabbitmq/rabbitmq.config
[
{rabbitmq_stomp, [{tcp_listeners, [12345]} , {default_user, [{login, "guest"},
{passcode, "kktest2"}]}]}
].
重启端口改了,用户名密码还是没该成功,不知道为啥