Class: Appfuel::Service::MsgRequest
- Inherits:
-
Request
- Object
- Request
- Appfuel::Service::MsgRequest
- Defined in:
- lib/appfuel/service/msg_request.rb
Instance Attribute Summary collapse
-
#delivery_info ⇒ Object
readonly
Returns the value of attribute delivery_info.
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
Instance Method Summary collapse
- #action_route? ⇒ Boolean
- #correlation_id ⇒ Object
-
#initialize(msg, delivery_info, properties) ⇒ Object
constructor
metadata properties headers: message headers action_route [String] reply_to: name of rpc response queue correlation_id: id used in rpc to match response.
- #reply_to ⇒ Object
-
#rpc? ⇒ Boolean
Rpc requires a reply queue to respond to and a correlation_id to identify that response in the queue.
Constructor Details
#initialize(msg, delivery_info, properties) ⇒ Object
metadata properties
headers: message headers
action_route [String]
reply_to: name of rpc response queue
correlation_id: id used in rpc to match response
17 18 19 20 21 22 23 24 |
# File 'lib/appfuel/service/msg_request.rb', line 17 def initialize(msg, delivery_info, properties) inputs = validate_inputs(msg) action_route = properties.headers['action_route'].to_s @properties = properties @delivery_info = delivery_info super(action_route, inputs) end |
Instance Attribute Details
#delivery_info ⇒ Object (readonly)
Returns the value of attribute delivery_info.
4 5 6 |
# File 'lib/appfuel/service/msg_request.rb', line 4 def delivery_info @delivery_info end |
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
4 5 6 |
# File 'lib/appfuel/service/msg_request.rb', line 4 def properties @properties end |
Instance Method Details
#action_route? ⇒ Boolean
43 44 45 |
# File 'lib/appfuel/service/msg_request.rb', line 43 def action_route? !action_route.empty? end |
#correlation_id ⇒ Object
39 40 41 |
# File 'lib/appfuel/service/msg_request.rb', line 39 def correlation_id properties.correlation_id end |
#reply_to ⇒ Object
35 36 37 |
# File 'lib/appfuel/service/msg_request.rb', line 35 def reply_to properties.reply_to end |
#rpc? ⇒ Boolean
Rpc requires a reply queue to respond to and a correlation_id to identify that response in the queue. When these two things exist then the request is consided to be an rpc
31 32 33 |
# File 'lib/appfuel/service/msg_request.rb', line 31 def rpc? !reply_to.nil? && !correlation_id.nil? end |