diff options
| author | Darryl L. Pierce <mcpierce@apache.org> | 2013-02-04 15:25:16 +0000 |
|---|---|---|
| committer | Darryl L. Pierce <mcpierce@apache.org> | 2013-02-04 15:25:16 +0000 |
| commit | b701ef37d28ab227255e604838381245ae3c9d32 (patch) | |
| tree | bff6aa080a95b7c210dda17b0fad9121a50b57fc /qpid/cpp | |
| parent | e0a5c07d88da859587d3e4a08846199aef2dd78f (diff) | |
| download | qpid-python-b701ef37d28ab227255e604838381245ae3c9d32.tar.gz | |
QPID-4562: Changed Message.reply_to to accept a address string.
Previously it would accept only an instance of Qpid::Messaging::Address,
but now will create an instance from a string if necessary.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1442149 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
| -rw-r--r-- | qpid/cpp/bindings/qpid/ruby/ChangeLog | 1 | ||||
| -rw-r--r-- | qpid/cpp/bindings/qpid/ruby/lib/qpid_messaging/message.rb | 8 | ||||
| -rw-r--r-- | qpid/cpp/bindings/qpid/ruby/spec/qpid_messaging/message_spec.rb | 13 |
3 files changed, 18 insertions, 4 deletions
diff --git a/qpid/cpp/bindings/qpid/ruby/ChangeLog b/qpid/cpp/bindings/qpid/ruby/ChangeLog index 4c96f91026..5fe9690b85 100644 --- a/qpid/cpp/bindings/qpid/ruby/ChangeLog +++ b/qpid/cpp/bindings/qpid/ruby/ChangeLog @@ -1,2 +1,3 @@ Verison 0.22: * Changed Qpid::Messaging::Address to use a URI on creation. + * Changed Qpid::Messaging::Message to allow a URI for reply_to. diff --git a/qpid/cpp/bindings/qpid/ruby/lib/qpid_messaging/message.rb b/qpid/cpp/bindings/qpid/ruby/lib/qpid_messaging/message.rb index 9e5425cdd2..aaf62ba93d 100644 --- a/qpid/cpp/bindings/qpid/ruby/lib/qpid_messaging/message.rb +++ b/qpid/cpp/bindings/qpid/ruby/lib/qpid_messaging/message.rb @@ -51,18 +51,18 @@ module Qpid # Sets the address to which replies should be sent for the +Message+. # - # *NOTE:* The address must be an instance of Address. - # # ==== Options # - # * address - an instance of +Address+ + # * address - an instance of +Address+, or an address URI # # ==== Examples # # msg.reply_to = Qpid:Messaging::Address.new "my-responses" + # msg.reply_to = "my-feed/responses" # def reply_to=(address) - raise ArgumentError, "Agument must be an Address" unless address.is_a? Qpid::Messaging::Address + address = Qpid::Messaging::Address.new "#{address}" if !address.is_a? Qpid::Messaging::Address + @message_impl.setReplyTo address.address_impl end diff --git a/qpid/cpp/bindings/qpid/ruby/spec/qpid_messaging/message_spec.rb b/qpid/cpp/bindings/qpid/ruby/spec/qpid_messaging/message_spec.rb index 17b92c13a5..be19b3591e 100644 --- a/qpid/cpp/bindings/qpid/ruby/spec/qpid_messaging/message_spec.rb +++ b/qpid/cpp/bindings/qpid/ruby/spec/qpid_messaging/message_spec.rb @@ -45,6 +45,19 @@ module Qpid reply_to.name.should == address.name end + it "can set the reply to from an address string" do + name = "my-queue" + subject = "responses" + address = "#{name}/#{subject}" + + @message.reply_to = address + + reply_to = @message.reply_to + + reply_to.name.should == name + reply_to.subject.should == subject + end + it "should store the content when created" do content = @message.content |
