[openamq-dev] Fwd: Ruby QPID libraries

Gordon Sim gsim at redhat.com
Wed Apr 30 19:30:26 CEST 2008


Carl Bourne wrote:
> Gordon,
> 
> Just ran your attached test script:
> 
> ruby newsend.rb ../amqp0-8.xml 2
> newsend.rb:15: undefined method `body=' for #<Qpid::Content:0xb7b93270> 
> (NoMethodError)
>     from newsend.rb:14:in `times'
>     from newsend.rb:14
> 
> Any pointers as to why it failed?

My stupidity I'm afraid. I had modified the client to allow the body to 
be set as a test. Thats not a good idea though and didn't make a great 
deal of difference anyway.

Please replace:

content = Qpid::Content.new({}, "Test Message")
iterations.times {|i|
   content.body = "Test Message #{i}"
   ch.basic_publish(:routing_key => "test-queue", :content => content )
}

with:

iterations.times {|i|
   content = Qpid::Content.new({}, "Test Message #{i}")
   ch.basic_publish(:routing_key => "test-queue", :content => content )
}

Apologies for that!


More information about the openamq-dev mailing list