class Conrad::Emitters::Kinesis
Basic emitter for sending events to AWS's kinesis event stream. The emitter will attempt to use values configured in the running environment according to the AWS SDK documentation (such as from ~/.aws/credentials).
Attributes
stream_name[RW]
@return [String] the configured kinesis stream name
Public Class Methods
client_class()
click to toggle source
# File lib/conrad/emitters/kinesis.rb, line 28 def client_class Aws::Kinesis::Client end
Public Instance Methods
call(event)
click to toggle source
Sends an event up to Kinesis
@param event [String] the event to be sent as a Kinesis
message body
# File lib/conrad/emitters/kinesis.rb, line 17 def call(event) client.put_record( stream_name: stream_name, data: event, # There's a 256 character limit on the partition key, and it's hashed down into a value used to # pick the shard to put the data on partition_key: event.first(255) ) end