php stomp rabbitmq,rabbitmq stomp 安装配置 -- kkito的博客

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"}]}]}

].

重启端口改了,用户名密码还是没该成功,不知道为啥

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值