Address represents an address to which messages can be sent or from which they can be received.
An Address can be described using the following pattern:
<address> [ / <subject> ] ; [ { <key> : <value> , … } ]
where address is a simple name and subject is a subject or subject pattern.
The options, enclosed in curly braces, are key:value pairs delimited by a comma. The values can be nested maps also enclosed in curly braces. Or they can be lists of values, where they are contained within square brackets but still comma delimited, such as:
[value1,value2,value3]
The following are the list of supported options:
Indicates if the address should be created; values are always, never, sender or reciever.
Indicates whether or not to assert any specified node properties; values are always, never, sender or receiver.
Indicates whether or not to delete the addressed node when a sender or receiver is cancelled; values are always, never, sender or receiver.
A nested map describing properties for the addressed node. Properties are type (topic or queue), durable (a boolean), x-declare (a nested map of amqp 0.10-specific options) and x-bindings. (nested list which specifies a queue, exchange or a binding key and arguments.
A nested map through which properties of the link can be specified; properties are durable, reliability, x-declare, x-subscribe and x-bindings.
(*For receivers only*) indicates whether the receiver should consume or browse messages; values are consume (the default) and browse.
Creates a new Address
object from an address string.
address - the address string
addr = Qpid::Messaging::Address.new "my-queue;{create:always}"
# File lib/qpid_messaging/address.rb, line 83 def initialize(address, address_impl = nil) @address_impl = address_impl || Cqpid::Address.new(address) end
Sets the type for the Address
.
The type of the address determines how Sender
and
Receiver
objects are constructed for it. If no type is
specified then it will be determined by querying the broker.
type - the address type
# File lib/qpid_messaging/address.rb, line 144 def address_type=(type); @address_impl.setType(type); end
Returns the options.
# File lib/qpid_messaging/address.rb, line 147 def options; @address_impl.getOptions; end
# File lib/qpid_messaging/address.rb, line 165 def convert_options(options) result = {} options.each_pair {|key, value| result[key.to_s] = value.to_s} return result end