Class: LSQS::Actions::SendMessageBatch
- Defined in:
- lib/lsqs/actions/send_message_batch.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#perform(params) ⇒ String
Performs the specific action.
Methods inherited from Base
#build_url, #initialize, #name, #to_xml
Constructor Details
This class inherits a constructor from LSQS::Actions::Base
Instance Method Details
#perform(params) ⇒ String
Performs the specific action.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/lsqs/actions/send_message_batch.rb', line 11 def perform(params) name = params['QueueName'] queue = queue_list.find(name) = params.select do |key, value| key.match(/SendMessageBatchRequestEntry\.\d+\.MessageBody/) end result = {} .each do |key, value| id = key.split('.')[1] msg_id = params["SendMessageBatchRequestEntry.#{id}.Id"] delay = params["SendMessageBatchRequestEntry.#{id}.DelaySeconds"] = queue.( 'MessageBody' => value, 'DelaySeconds' => delay ) result[msg_id] = end result.each do |msg_id, | builder.SendMessageBatchResultEntry do builder.MD5OfMessageBody .md5 builder.MessageId .id builder.Id msg_id end end end |