Class: Legion::Transport::Messages::RegionReRoute
- Inherits:
-
Legion::Transport::Message
- Object
- Legion::Transport::Message
- Legion::Transport::Messages::RegionReRoute
- Defined in:
- lib/legion/transport/messages/region_re_route.rb
Constant Summary
Constants inherited from Legion::Transport::Message
Legion::Transport::Message::ENVELOPE_KEYS
Constants included from Common
Instance Method Summary collapse
Methods inherited from Legion::Transport::Message
#app_id, #channel, #content_encoding, #content_type, #correlation_id, #encode_message, #encrypt?, #encrypt_message, #exchange_name, #expiration, #headers, #initialize, max_payload_bytes, #message_id, #persistent, #priority, #publish, #reply_to, #timestamp, #type, #user_id
Methods included from Common
#channel, #channel_open?, #close, #close!, #deep_merge, #generate_consumer_tag, #open_channel, #options_builder
Constructor Details
This class inherits a constructor from Legion::Transport::Message
Instance Method Details
#exchange ⇒ Object
7 8 9 |
# File 'lib/legion/transport/messages/region_re_route.rb', line 7 def exchange Legion::Transport::Exchanges::Task end |
#message ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/legion/transport/messages/region_re_route.rb', line 15 def { original_payload: @options[:original_payload] || @options.except(:target_region), target_region: target_region, source_region: source_region, rerouted_at: Time.now.to_i } end |
#routing_key ⇒ Object
11 12 13 |
# File 'lib/legion/transport/messages/region_re_route.rb', line 11 def routing_key "region.reroute.#{target_region}" end |
#validate ⇒ Object
24 25 26 27 28 |
# File 'lib/legion/transport/messages/region_re_route.rb', line 24 def validate raise ArgumentError, 'target_region is required' unless @options[:target_region].is_a?(String) && !@options[:target_region].empty? @valid = true end |