Class: Bunny::MessageProperties

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/bunny/message_properties.rb

Overview

Wraps basic properties hash as returned by amq-protocol to provide access to the delivery properties as immutable hash as well as methods.

Instance Method Summary collapse

Instance Method Details

#[](k) ⇒ Object

Accesses message properties by key

See Also:

  • Hash#[]


32
33
34
# File 'lib/bunny/message_properties.rb', line 32

def [](k)
  @properties[k]
end

#app_idString

Returns Publishing application, as set by the publisher.

Returns:

  • (String)

    Publishing application, as set by the publisher



112
113
114
# File 'lib/bunny/message_properties.rb', line 112

def app_id
  @properties[:app_id]
end

#cluster_idString

Returns Cluster ID, as set by the publisher.

Returns:

  • (String)

    Cluster ID, as set by the publisher



117
118
119
# File 'lib/bunny/message_properties.rb', line 117

def cluster_id
  @properties[:cluster_id]
end

#content_encodingString

Returns (Optional) content encoding of the message, as set by the publisher.

Returns:

  • (String)

    (Optional) content encoding of the message, as set by the publisher



57
58
59
# File 'lib/bunny/message_properties.rb', line 57

def content_encoding
  @properties[:content_encoding]
end

#content_typeString

Returns (Optional) content type of the message, as set by the publisher.

Returns:

  • (String)

    (Optional) content type of the message, as set by the publisher



52
53
54
# File 'lib/bunny/message_properties.rb', line 52

def content_type
  @properties[:content_type]
end

#correlation_idString

Returns What message this message is a reply to (or corresponds to), as set by the publisher.

Returns:

  • (String)

    What message this message is a reply to (or corresponds to), as set by the publisher



77
78
79
# File 'lib/bunny/message_properties.rb', line 77

def correlation_id
  @properties[:correlation_id]
end

#delivery_modeInteger

Returns Delivery mode (persistent or transient).

Returns:

  • (Integer)

    Delivery mode (persistent or transient)



67
68
69
# File 'lib/bunny/message_properties.rb', line 67

def delivery_mode
  @properties[:delivery_mode]
end

#each(*args, &block) ⇒ Object

Iterates over the message properties

See Also:

  • Enumerable#each


26
27
28
# File 'lib/bunny/message_properties.rb', line 26

def each(*args, &block)
  @properties.each(*args, &block)
end

#expirationString

Returns Message expiration, as set by the publisher.

Returns:

  • (String)

    Message expiration, as set by the publisher



87
88
89
# File 'lib/bunny/message_properties.rb', line 87

def expiration
  @properties[:expiration]
end

#headersString

Returns Message headers.

Returns:

  • (String)

    Message headers



62
63
64
# File 'lib/bunny/message_properties.rb', line 62

def headers
  @properties[:headers]
end

#message_idString

Returns Message ID, as set by the publisher.

Returns:

  • (String)

    Message ID, as set by the publisher



92
93
94
# File 'lib/bunny/message_properties.rb', line 92

def message_id
  @properties[:message_id]
end

#priorityInteger

Returns Message priority, as set by the publisher.

Returns:

  • (Integer)

    Message priority, as set by the publisher



72
73
74
# File 'lib/bunny/message_properties.rb', line 72

def priority
  @properties[:priority]
end

#reply_toString

Returns (Optional) How to reply to the publisher (usually a reply queue name).

Returns:

  • (String)

    (Optional) How to reply to the publisher (usually a reply queue name)



82
83
84
# File 'lib/bunny/message_properties.rb', line 82

def reply_to
  @properties[:reply_to]
end

#timestampTime

Returns Message timestamp, as set by the publisher.

Returns:

  • (Time)

    Message timestamp, as set by the publisher



97
98
99
# File 'lib/bunny/message_properties.rb', line 97

def timestamp
  @properties[:timestamp]
end

#to_hashHash

Returns Hash representation of this delivery info.

Returns:

  • (Hash)

    Hash representation of this delivery info



37
38
39
# File 'lib/bunny/message_properties.rb', line 37

def to_hash
  @properties
end

#typeString

Returns Message type, as set by the publisher.

Returns:

  • (String)

    Message type, as set by the publisher



102
103
104
# File 'lib/bunny/message_properties.rb', line 102

def type
  @properties[:type]
end

#user_idString

Returns Publishing user, as set by the publisher.

Returns:

  • (String)

    Publishing user, as set by the publisher



107
108
109
# File 'lib/bunny/message_properties.rb', line 107

def user_id
  @properties[:user_id]
end