我尝试将Bunny用于Azure EventHub,实际上Bunny支持AMQP 0.9.1,而AMQP 0.9.1与AMQP 1.0兼容。

但是,执行以下代码时出现错误。

conn = Bunny.new('amqps://[username]:[password]@[namespace].servicebus.windows.net/[virtualhost]', :ssl => true)
conn.start

AMQ::Protocol::FrameTypeError: Must be one of [:method, :headers, :body, :heartbeat]
    from /opt/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/amq-protocol-1.9.2/lib/amq/protocol/frame.rb:64:in `decode_header'
    from /opt/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bunny-1.6.3/lib/bunny/transport.rb:243:in `read_next_frame'
    from /opt/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bunny-1.6.3/lib/bunny/session.rb:947:in `init_connection'
    from /opt/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bunny-1.6.3/lib/bunny/session.rb:275:in `start'
    from (irb):5
    from /opt/rbenv/versions/2.1.2/bin/irb:11:in `<main>'


有谁知道如何修理它?还是不能用于EventHub?

我的环境如下:


CentOS的:6.6
红宝石:2.1.2
兔子:1.6.3
兔子协议版本:0.9.1

最佳答案

我认为您需要安装创建符合AMQP 1.0要求的实验性插件

参见:https://www.rabbitmq.com/specification.html

插件源:https://github.com/rabbitmq/rabbitmq-amqp1.0

关于ruby - 我可以为EventHub使用ruby模块“Bunny”吗?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/26915984/

10-12 16:13