1 Star 0 Fork 0

GeekWN/vertx-examples

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
receiver.rb 639 Bytes
一键复制 编辑 原始数据 按行查看 历史
require 'vertx-amqp-bridge/amqp_bridge'
bridge = VertxAmqpBridge::AmqpBridge.create($vertx)
# Start the bridge, then use the event loop thread to process things thereafter.
bridge.start("localhost", 5672) { |res_err,res|
if (res_err != nil)
puts "Bridge startup failed: #{res_err}"
return
end
# Set up a consumer using the bridge, register a handler for it.
consumer = bridge.create_consumer("myAmqpAddress")
consumer.handler() { |vertxMsg|
amqpMsgPayload = vertxMsg.body()
amqpBody = amqpMsgPayload["body"]
# Print body of received AMQP message
puts "Received a message with body: #{amqpBody}"
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/geekwn/vertx-examples.git
git@gitee.com:geekwn/vertx-examples.git
geekwn
vertx-examples
vertx-examples
master

搜索帮助

A270a887 8829481 3d7a4017 8829481