Bunny 9.2 发布了,该版本确保在任意连接恢复之前初始化新的连接传输 (socket),提升了自动网络失效时的恢复。详情请看 ChangeLog。
Bunny 是一个非常受欢迎的、易用的、可维护的 RabbitMQ 2.0+ 的 Ruby 客户端开发包。
示例代码:
require "bunny"
# Start a communication session with RabbitMQ
conn = Bunny.new
conn.start
# open a channel
ch = conn.create_channel
# declare a queue
q = ch.queue("test1")
# publish a message to the default exchange which then gets routed to this queue
q.publish("Hello, everybody!")
# fetch a message from the queue
delivery_info, metadata, payload = q.pop
puts "This is the message: #{payload}"
# close the connection
conn.stop
Bunny 的下载地址:请点这里
