ActiveMQ的新手。使用紅寶石跺腳寶石。我相信我已成功地將消息發佈到服務器,正如我在瀏覽器管理客戶端的隊列中看到的那樣。但在訂閱上沒有任何反應,沒有錯誤,沒有輸出。來自puts的「in subscribe」測試文本不會出現在stdout中,msg也不會出現。ActiveMQ with Ruby Stomp gem - 訂閱失敗
我應該爲隊列使用不同的命名格式嗎?
require 'stomp'
port = 61613
client = Stomp::Client.new('admin', 'admin', '127.0.0.1', port)
client.publish("/queue/mine2", "hello world!")
puts "about to subscribe"
client.subscribe("/queue/mine2") do |msg|
puts "in subscribe"
puts msg
end
client.close
非常感謝! – bethesdaboys