logstash-plugins / logstash-input-kinesis

Logstash Plugin for AWS Kinesis Input
Apache License 2.0
45 stars 57 forks source link

Support ddb billing mode in additional_settings #97

Open c4pQ opened 1 year ago

c4pQ commented 1 year ago

[enhancement]

Release notes

What does this PR do?

It allows to set DynamoDB BillingMode from pipeline yaml config's additional_settings map. As BillingMode in Java can not be casted from String or Int to BillingMode on the fly we have to cast it manually before passing from Ruby to Java.

input {
  kinesis {
    application_name => "kinesis_application_kcl"
    kinesis_stream_name => "test"
    codec => json_lines
    profile => "default"
    additional_settings => {
      billing_mode => "PAY_PER_REQUEST"
    }
  }
}
output {
    stdout{codec => rubydebug}
}

Why is it important/What is the impact to the user?

This PR gives an opportunity to tune one additional setting of Kinesis Client and avoid erroneous behavior.

Behavior before changes:

[ERROR] 2023-01-09 07:31:49.865 [[main]-pipeline-manager] javapipeline - Pipeline error {:pipeline_id=>"main", :exception=>#<TypeError: cannot convert instance of class org.jruby.RubyString to class com.amazonaws.services.dynamodbv2.model.BillingMode>...

KCL version's bump keeps plugin updated.

Checklist

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

cla-checker-service[bot] commented 1 year ago

💚 CLA has been signed