Red Hat Bugzilla – Bug 507538
method exchange_declare is missing in ruby qpid session class
Last modified: 2015-11-15 19:07:19 EST
I try to write ruby test client and I find that session hasn't method called exchange_declare like python version does. I'm using ruby-qpid-0.4.749380-2.el5, but I cannot find it in svn revision 787585 too. Am I doing something wrong or is a bug? Test client: require 'qpid' # define parameters # ------------------------------------------------------------------------- options = { :broker_host =>"127.0.0.1", :broker_port => 5672, :auth_user => "guest", :auth_pass => "guest", :exchange_name => "test-name", :exchange_type => "topic", :exchange_durable => false, :exchange_auto_delete => false, } # Create a socket & connection. # ------------------------------------------------------------------------- begin connection = Qpid::Connection.new(TCPSocket.new(options[:broker_host], options[:broker_port]), {:username => options[:auth_user], :password => options[:auth_pass]}) # start connection and session # ----------------------------------------------------------------------- connection.start() session = connection.session(name=Qpid::UUID.uuid4().to_s) rescue Exception => ex raise "Cannot connect to the broker #{options[:broker_host]}:#{options[:broker_port]}. Exception name: #{ex}" end begin session.exchange_declare(exchange=options[:exchange_name], durable=options[:exchange_durable], auto_delete=options[:exchange_auto_delete], type=options[:exchange_type], arguments={}) rescue Exception => e session.close(timeout=10) puts e.backtrace.join("\n") raise "Cannot declare exchange[s], session.exchange_declare() exception. #{e}" end # close session & connection # ------------------------------------------------------------------------- session.close(timeout=10)
I can confirm this is a bug. It is fixed on trunk as of svn revision 787663.
The exchange_declare was implemented and is functional. Tested on RHEL 5.5 i386 / x86_64 on package: ruby-qpid-0.7.946106-2.el5 -> VERIFIED
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2010-0773.html