Man*_*noj 4 ruby activemq-classic stomp
我正在使用stomp从Ruby向ActiveMQ写消息.我在http://calliopesounds.blogspot.com/2009/07/working-ruby-stomp-example.html上关注示例
但是我得到了以下错误,不确定是什么问题
/Library/Ruby/Gems/1.8/gems/stomp-1.1.10/lib/stomp/connection.rb:462:in `write': Invalid argument (Errno::EINVAL)
from /Library/Ruby/Gems/1.8/gems/stomp-1.1.10/lib/stomp/connection.rb:462:in `puts'
from /Library/Ruby/Gems/1.8/gems/stomp-1.1.10/lib/stomp/connection.rb:462:in `_transmit'
from /Library/Ruby/Gems/1.8/gems/stomp-1.1.10/lib/stomp/connection.rb:462:in `each'
from /Library/Ruby/Gems/1.8/gems/stomp-1.1.10/lib/stomp/connection.rb:462:in `_transmit'
from /Library/Ruby/Gems/1.8/gems/stomp-1.1.10/lib/stomp/connection.rb:445:in `synchronize'
from /Library/Ruby/Gems/1.8/gems/stomp-1.1.10/lib/stomp/connection.rb:445:in `_transmit'
from /Library/Ruby/Gems/1.8/gems/stomp-1.1.10/lib/stomp/connection.rb:427:in `transmit'
from /Library/Ruby/Gems/1.8/gems/stomp-1.1.10/lib/stomp/connection.rb:267:in `publish'
from /Library/Ruby/Gems/1.8/gems/stomp-1.1.10/lib/stomp/client.rb:200:in `publish'
from utils.rb:10
Run Code Online (Sandbox Code Playgroud)
这是脚本
require 'rubygems'
require 'stomp'
queue = "/queue/msg.in"
puts "Producer for queue #{queue}"
client = Stomp::Client.open "stomp://localhost:61616"
puts client
client.publish queue, "hello!"
client.close
Run Code Online (Sandbox Code Playgroud)
这可能不是你的确切问题,但由于代码在发送上窒息,它可能是类似的东西.
默认情况下,localhost:61616是AMQ代理侦听openwire连接的位置.您是否更改了代理xml配置以在该端口上使用stomp?配置应该有一个条目,如:
<transportConnectors>
<transportConnector name="stomp" uri="stomp://localhost:61613"/>
</transportConnectors>
Run Code Online (Sandbox Code Playgroud)