Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby和ActiveMQ。AMQ339016:创建订阅Stomp时出错::错误::BrokerException_Ruby_Activemq - Fatal编程技术网

Ruby和ActiveMQ。AMQ339016:创建订阅Stomp时出错::错误::BrokerException

Ruby和ActiveMQ。AMQ339016:创建订阅Stomp时出错::错误::BrokerException,ruby,activemq,Ruby,Activemq,我正在运行一个简单的Ruby程序来生成和使用ActiveMQ Stomp消息。我不断地犯这个错误 /root/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/stomp-1.3.4/lib/stomp/client.rb:132:in `join': AMQ339016: Error creating subscription f7b282396a9bef2da1ccd42d16dc511758234113 (Stomp::Erro

我正在运行一个简单的Ruby程序来生成和使用ActiveMQ Stomp消息。我不断地犯这个错误

    /root/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/stomp-1.3.4/lib/stomp/client.rb:132:in `join': AMQ339016: Error creating subscription f7b282396a9bef2da1ccd42d16dc511758234113 (Stomp::Error::BrokerException)
    from /root/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/stomp-1.3.4/lib/stomp/client.rb:132:in `join'
    from consumer.rb:10:in `<main>'
完整的示例代码可在此处找到:


我找到了一个解决办法。我发现的例子很古老。将ActiveMQ从版本6降级到版本4.1.2后,问题消失了。我还没有尝试过任何5.x版本。配置文件的设置已从版本4.1.2显著更改为版本6。如何在最新版本的ActiveMQ中实现这一点仍然很好
    require 'rubygems'
    require 'stomp'

    client = Stomp::Client.open "stomp://localhost:61613"
    client.subscribe "/queue/myqueue" do |message|
    puts "received: #{message.body} on #{message.headers['destination']}"
    end
    client.join
    client.close
    puts "completed process"