Class Qpid::Proton::Message
In: lib/core/message.rb
Parent: Object

A Message represents an addressable quantity of data.

Message Body

The message body can be set using the body= method. The message will then attempt to determine how exactly to encode the content.

Examples

To create a message for sending:

  # send a simple text message
  msg = Qpid::Proton::Message.new
  msg.body = "STATE: update"

  # send a binary chunk of data
  data = File.binread("/home/qpid/binfile.tar.gz")
  msg = Qpid::Proton::Message.new
  msg.body = Qpid::Proton::BinaryString.new(data)

Methods

Public Class methods

Creates a new Message instance.

Public Instance methods

Retrieves the value for the specified property name. If not found, then it returns nil.

Assigns the value given to the named property.

Arguments

  • name - the property name
  • value - the property value

Returns the destination address.

Sets the destination address.

Options

Returns the annotations for this message.

Assigns annotations to this message.

Returns the body property of the message.

Assigns a new value to the body of the message.

Clears the state of the Message. This allows a single instance of Message to be reused.

Returns the message content.

*WARNING:* This method has been deprecated. Please use body instead to retrieve the content of a message.

Sets the message content.

*WARNING:* This method has been deprecated. Please use body= instead to set the content of a message.

Options

Returns the content encoding type.

Sets the content encoding type.

Options

Returns the content type

Sets the content type.

Options

Returns the correlation id.

Sets the correlation id.

Options

  • id - the correlation id

Returns the creation time.

Sets the creation time.

Options

  • time - the creation time

Decodes a message from supplied AMQP data and returns the number of bytes consumed.

Options

  • encoded - the encoded data

Deletes the named property.

Returns the delivery count for the message.

This is the number of delivery attempts for the given message.

Sets the delivery count for the message.

See ::delivery_count for more details.

Options

  • count - the delivery count

Returns the durable property.

The durable property indicates that the emessage should be held durably by any intermediaries taking responsibility for the message.

Examples

 msg = Qpid::Proton::Message.new
 msg.durable = true

Sets the durable flag.

See ::durable for more details on message durability.

Options

Encodes the message.

Returns the most recent error number.

Returns the most recent error message.

Returns whether there is currently an error reported.

Returns the expiration time.

Sets the expiration time.

Options

  • time - the expiry time

Sets whether this is the first time the message was acquired.

See ::first_acquirer? for more details.

Options

  • state - true if claiming the message

Returns whether this is the first acquirer.

Returns the group id.

Sets the group id.

Options

Returns the group sequence number.

Sets the group sequence number.

Options

  • seq - the sequence number

Returns the message id.

Sets the message id.

Options

Returns the instructions for this message.

Assigns instructions to this message.

Returns the priority.

Sets the priority.

+NOTE:+ Priority values are limited to the range [0,255].

Options

Returns the list of property names for associated with this message.

Examples

  msg.properties.each do |name|
  end

Replaces the entire set of properties with the specified hash.

Returns the reply-to address

Sets the reply-to address.

Options

Returns the reply-to group id.

Sets the reply-to group id.

Options

Returns the subject

Sets the subject.

Options

Returns the time-to-live, in milliseconds.

Sets the time-to-live for the message.

Options

  • time - the time in milliseconds

Returns the user id.

Sets the user id.

Options

[Validate]