Class: Conrad::Emitters::Sqs

Inherits:
AmazonBase show all
Defined in:
lib/conrad/emitters/sqs.rb

Overview

Basic emitter for sending events to AWS’s sqs. If all access information is given, the given credentials will be used. Otherwise, the emitter will attempt to use values configured in the running environment according to the AWS SDK documentation (such as from ~/.aws/credentials).

Instance Attribute Summary collapse

Attributes inherited from AmazonBase

#access_key_id, #client, #region, #secret_access_key

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AmazonBase

#initialize

Constructor Details

This class inherits a constructor from Conrad::Emitters::AmazonBase

Instance Attribute Details

#queue_urlString

Returns the configured SQS queue URL.

Returns:

  • (String)

    the configured SQS queue URL



13
14
15
# File 'lib/conrad/emitters/sqs.rb', line 13

def queue_url
  @queue_url
end

Class Method Details

.client_classObject



23
24
25
# File 'lib/conrad/emitters/sqs.rb', line 23

def client_class
  Aws::SQS::Client
end

Instance Method Details

#call(event) ⇒ Object

Sends an event up to SQS

Parameters:

  • event (String)

    the event to be sent as an SQS message body



18
19
20
# File 'lib/conrad/emitters/sqs.rb', line 18

def call(event)
  client.send_message(queue_url: queue_url, message_body: event)
end