Class | Qpid::Messaging::Message |
In: |
lib/qpid/message.rb
|
Parent: | Object |
Returns the value for the named property.
# use of message properties to mark a message as digitally signed verify(msg) if msg[:signed]
Assigns a value to the named property.
*NOTE:* Both the key or the value may be a symbol, but they will both be converted to a String for ease of transport.
Returns the content of the Message.
Content is automatically decoded based on the specified content type. If the content type is application-specific, then no decoding is performed and the content is returnedas a String representation.
For example, if an array of integers are sent, then the receiver will find the message content to be an array of String objects, where each String is a representation of the sent integer value.
Sets the content for the Message.
Content is automatically encoded for Array and Hash types. Other types need to set their own content types (via content_type) in order to specify how recipients should process the content.
msg.content = "This is a simple message." # a simple message msg.content = {:foo => :bar} # content is automatically encoded
Sets the content type for the Message.
This should be set by the sending applicaton and indicates to recipients of the message how to interpret or decode the content.
By default, only dictionaries and maps are automatically given a content type. If this content type is replaced then retrieving the content will not behave correctly.
Returns the correlation id of the Message.
*NOTE:* See +correlation_id=+ for details.
Sets the correlation id of the Message.
The correlation id can be used as part of a protocol for message exchange patterns; e.g., a requestion-response pattern might require the correlation id of the request and the response to match, or it might use the message id of the request as the correlation id on the response
*NOTE:* If the id is not a String then the id is setup using the object‘s string representation.
Sets the message id.
*NOTE:* this field must be a UUID type currently. A non-UUID value will be converted to a zero UUID, though a blank ID will be left untouched.
Sets the priority of the Message.
This may be used by the messaging infrastructure to prioritize delivery of messages with higher priority.
*NOTE:* If the priority is not an integer type then it is set using the object‘s integer representation. If the integer value is greater than 8-bits then only the first 8-bits are used.
Returns all named properties.
*NOTE:* It is recommended to use the []= method for retrieving and setting properties. Using this method may result in non-deterministic behavior.
This is a hint to the messaging infrastructure that if de-duplication is required, that this message should be examined to determine if it is a duplicate.
# processed is an array of processed message ids msg.redelivered = true if processed.include? msg.message_id
Sets the user id for the Message.
This should in general be the user-id which was used when authenticating the connection itself, as the messaging infrastructure will verify this.
See +Qpid::Messaging::Connection.authenticated_username+
*NOTE:* If the id is not a String then the id is set using the object‘s string representation.