Sha256: 9770a9ae6882427a2d761c16c8c86893c7dd433a40041505e345a985dc7fced8

Contents?: true

Size: 803 Bytes

Versions: 4

Compression:

Stored size: 803 Bytes

Contents

require 'aws-sdk'
require 'logstash-logger/device/aws_stream'

module LogStashLogger
  module Device
    class Kinesis < AwsStream
      @stream_class = ::Aws::Kinesis::Client
      @recoverable_error_codes = [
        "ServiceUnavailable",
        "Throttling",
        "RequestExpired",
        "ProvisionedThroughputExceededException"
      ].freeze

      def transform_message(message)
        {
          data: message,
          partition_key: SecureRandom.uuid
        }
      end

      def put_records(records)
        @io.put_records({
          records: records,
          stream_name: @stream
        })
      end

      def is_successful_response(resp)
        resp.failed_record_count == 0
      end

      def get_response_records(resp)
        resp.records
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
logstash-logger-0.25.1 lib/logstash-logger/device/kinesis.rb
logstash-logger-0.25.0 lib/logstash-logger/device/kinesis.rb
logstash-logger-0.24.1 lib/logstash-logger/device/kinesis.rb
logstash-logger-0.24.0 lib/logstash-logger/device/kinesis.rb