Class: Bunny::MessageProperties
- Inherits:
-
Object
- Object
- Bunny::MessageProperties
- 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
-
#[](k) ⇒ Object
Accesses message properties by key.
-
#app_id ⇒ String
Publishing application, as set by the publisher.
-
#cluster_id ⇒ String
Cluster ID, as set by the publisher.
-
#content_encoding ⇒ String
(Optional) content encoding of the message, as set by the publisher.
-
#content_type ⇒ String
(Optional) content type of the message, as set by the publisher.
-
#correlation_id ⇒ String
What message this message is a reply to (or corresponds to), as set by the publisher.
-
#delivery_mode ⇒ Integer
Delivery mode (persistent or transient).
-
#each(*args, &block) ⇒ Object
Iterates over the message properties.
-
#expiration ⇒ String
Message expiration, as set by the publisher.
-
#headers ⇒ String
Message headers.
-
#message_id ⇒ String
Message ID, as set by the publisher.
-
#priority ⇒ Integer
Message priority, as set by the publisher.
-
#reply_to ⇒ String
(Optional) How to reply to the publisher (usually a reply queue name).
-
#timestamp ⇒ Time
Message timestamp, as set by the publisher.
-
#to_hash ⇒ Hash
Hash representation of this delivery info.
-
#type ⇒ String
Message type, as set by the publisher.
-
#user_id ⇒ String
Publishing user, as set by the publisher.
Instance Method Details
#[](k) ⇒ Object
Accesses message properties by key
32 33 34 |
# File 'lib/bunny/message_properties.rb', line 32 def [](k) @properties[k] end |
#app_id ⇒ String
Returns 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_id ⇒ String
Returns 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_encoding ⇒ String
Returns (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_type ⇒ String
Returns (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_id ⇒ String
Returns 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_mode ⇒ Integer
Returns 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
26 27 28 |
# File 'lib/bunny/message_properties.rb', line 26 def each(*args, &block) @properties.each(*args, &block) end |
#expiration ⇒ String
Returns Message expiration, as set by the publisher.
87 88 89 |
# File 'lib/bunny/message_properties.rb', line 87 def expiration @properties[:expiration] end |
#headers ⇒ String
Returns Message headers.
62 63 64 |
# File 'lib/bunny/message_properties.rb', line 62 def headers @properties[:headers] end |
#message_id ⇒ String
Returns Message ID, as set by the publisher.
92 93 94 |
# File 'lib/bunny/message_properties.rb', line 92 def @properties[:message_id] end |
#priority ⇒ Integer
Returns Message priority, as set by the publisher.
72 73 74 |
# File 'lib/bunny/message_properties.rb', line 72 def priority @properties[:priority] end |
#reply_to ⇒ String
Returns (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 |
#timestamp ⇒ Time
Returns Message timestamp, as set by the publisher.
97 98 99 |
# File 'lib/bunny/message_properties.rb', line 97 def @properties[:timestamp] end |
#to_hash ⇒ Hash
Returns Hash representation of this delivery info.
37 38 39 |
# File 'lib/bunny/message_properties.rb', line 37 def to_hash @properties end |
#type ⇒ String
Returns Message type, as set by the publisher.
102 103 104 |
# File 'lib/bunny/message_properties.rb', line 102 def type @properties[:type] end |
#user_id ⇒ String
Returns 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 |