    # File lib/fog/aws/requests/sqs/receive_message.rb, line 34
            def receive_message(queue_url, options = {})
              Excon::Response.new.tap do |response|
                if (queue = data[:queues][queue_url])
                  max_number_of_messages = options['MaxNumberOfMessages'] || 1
                  now = Time.now

                  messages = []

                  queue[:messages].values.each do |m|
                    message_id = m['MessageId']

                    invisible = if (received_handles = queue[:receipt_handles][message_id])
                      visibility_timeout = m['Attributes']['VisibilityTimeout'] || queue['Attributes']['VisibilityTimeout']
                      received_handles.any? { |handle, time| now < time + visibility_timeout }
                    else
                      false
                    end

                    unless invisible
                      receipt_handle = Fog::Mock.random_base64(300)

                      queue[:receipt_handles][message_id] ||= {}
                      queue[:receipt_handles][message_id][receipt_handle] = now

                      m['Attributes'].tap do |attrs|
                        attrs['ApproximateFirstReceiveTimestamp'] ||= now
                        attrs['ApproximateReceiveCount'] = (attrs['ApproximateReceiveCount'] || 0) + 1
                      end

                      messages << m.merge({
                        'ReceiptHandle' => receipt_handle
                      })
                      break if messages.size >= max_number_of_messages
                    end
                  end

                  response.body = {
                    'ResponseMetadata' => {
                      'RequestId' => Fog::AWS::Mock.request_id
                    },
                    'Message' => messages
                  }
                  response.status = 200
                else
                  response.status = 404
                  raise(Excon::Errors.status_error({:expects => 200}, response))
                end
              end
            end