logstash-input-kinesis 2.0.5-java → 2.0.6-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f3e4d9614e4481f001a52c155e113fa7597462bd6d23961e3ae925895b5c800f
4
- data.tar.gz: 35e2f182b3c99631a5dc8585b161239b3d25881654869423d84cad7cff3394ae
3
+ metadata.gz: a75cb55ecad3e17ace50ce97f2355844a29b65f599c74f8f66ac1133de2066e9
4
+ data.tar.gz: b46a6227ead8f3c7b261ebb9943b07fad225818dccffffd115b741776c7aa370
5
5
  SHA512:
6
- metadata.gz: 0aa496b90b0bc671323218b4a1d057857c518745a9e5b2eff66272598f37507a7ea4fc049f48e405c480ad56beafd1f69bad6cd22fdc8e230d429f28a9de1295
7
- data.tar.gz: e6461c17ea75489281a20cb216494d864559bb6ea59a3f5dc69b0a2f997038a8d97f9b27ac2c980f2c53a6e8ed4357a339dc31c66e84963546c49aaf618e6079
6
+ metadata.gz: ebe78e4ca63b7ec51070b969cef14c4efed64673f5ad79377194e250d39ac1e249cd2f5f6c44669bdca946ff66c42be0377f8b0d3890c224846d6397a51d690e
7
+ data.tar.gz: ce0656e2b85a270406b67e9f0191d78cbcccab04663f28198031e19a54a809609c310adf404157b99f1e9e885d69d8c46d54dff778e5a39386b934950d7f60ec
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 2.0.6
2
+ - Fix some documentation issues
3
+ - Add support for `initial_position_in_stream` config parameter. `TRIM_HORIZON` and `LATEST` are supported.
4
+
1
5
  ## 2.0.5
2
6
  - Docs: Add CHANGELOG.md
3
7
  - Support for specifying an AWS credentials profile with the `profile` config parameter
data/README.md CHANGED
@@ -49,6 +49,9 @@ This are the properties you can configure and what are the default values:
49
49
  * `profile`: The AWS profile name for authentication. This ensures that the `~/.aws/credentials` AWS auth provider is used. By default this is empty and the default chain will be used.
50
50
  * **required**: false
51
51
  * **default value**: `""`
52
+ * `initial_position_in_stream`: The value for initialPositionInStream. Accepts "TRIM_HORIZON" or "LATEST".
53
+ * **required**: false
54
+ * **default value**: `"TRIM_HORIZON"`
52
55
 
53
56
  ## Authentication
54
57
 
@@ -53,6 +53,9 @@ class LogStash::Inputs::Kinesis < LogStash::Inputs::Base
53
53
  # Select AWS profile for input
54
54
  config :profile, :validate => :string
55
55
 
56
+ # Select initial_position_in_stream. Accepts TRIM_HORIZON or LATEST
57
+ config :initial_position_in_stream, :validate => ["TRIM_HORIZON", "LATEST"], :default => "TRIM_HORIZON"
58
+
56
59
  def initialize(params = {})
57
60
  super(params)
58
61
  end
@@ -75,12 +78,18 @@ class LogStash::Inputs::Kinesis < LogStash::Inputs::Base
75
78
  else
76
79
  creds = com.amazonaws.auth::DefaultAWSCredentialsProviderChain.new
77
80
  end
81
+ initial_position_in_stream = if @initial_position_in_stream == "TRIM_HORIZON"
82
+ KCL::InitialPositionInStream::TRIM_HORIZON
83
+ else
84
+ KCL::InitialPositionInStream::LATEST
85
+ end
86
+
78
87
  @kcl_config = KCL::KinesisClientLibConfiguration.new(
79
88
  @application_name,
80
89
  @kinesis_stream_name,
81
90
  creds,
82
91
  worker_id).
83
- withInitialPositionInStream(KCL::InitialPositionInStream::TRIM_HORIZON).
92
+ withInitialPositionInStream(initial_position_in_stream).
84
93
  withRegionName(@region)
85
94
  end
86
95
 
@@ -2,7 +2,7 @@
2
2
  module Logstash
3
3
  module Input
4
4
  module Kinesis
5
- VERSION = "2.0.5"
5
+ VERSION = "2.0.6"
6
6
  end
7
7
  end
8
8
  end
@@ -26,6 +26,18 @@ RSpec.describe "inputs/kinesis" do
26
26
  "profile" => "my-aws-profile"
27
27
  }}
28
28
 
29
+ # other config with LATEST as initial_position_in_stream
30
+ let(:config_with_latest) {{
31
+ "application_name" => "my-processor",
32
+ "kinesis_stream_name" => "run-specs",
33
+ "codec" => codec,
34
+ "metrics" => metrics,
35
+ "checkpoint_interval_seconds" => 120,
36
+ "region" => "ap-southeast-1",
37
+ "profile" => nil,
38
+ "initial_position_in_stream" => "LATEST"
39
+ }}
40
+
29
41
  subject!(:kinesis) { LogStash::Inputs::Kinesis.new(config) }
30
42
  let(:kcl_worker) { double('kcl_worker') }
31
43
  let(:stub_builder) { double('kcl_builder', build: kcl_worker) }
@@ -54,6 +66,17 @@ RSpec.describe "inputs/kinesis" do
54
66
  expect(kinesis_with_profile.kcl_config.get_kinesis_credentials_provider.getClass.to_s).to eq("com.amazonaws.auth.profile.ProfileCredentialsProvider")
55
67
  end
56
68
 
69
+ subject!(:kinesis_with_latest) { LogStash::Inputs::Kinesis.new(config_with_latest) }
70
+
71
+ it "configures the KCL" do
72
+ kinesis_with_latest.register
73
+ expect(kinesis_with_latest.kcl_config.applicationName).to eq("my-processor")
74
+ expect(kinesis_with_latest.kcl_config.streamName).to eq("run-specs")
75
+ expect(kinesis_with_latest.kcl_config.regionName).to eq("ap-southeast-1")
76
+ expect(kinesis_with_latest.kcl_config.initialPositionInStream).to eq(KCL::InitialPositionInStream::LATEST)
77
+ expect(kinesis_with_latest.kcl_config.get_kinesis_credentials_provider.getClass.to_s).to eq("com.amazonaws.auth.DefaultAWSCredentialsProviderChain")
78
+ end
79
+
57
80
  context "#run" do
58
81
  it "runs the KCL worker" do
59
82
  expect(kinesis).to receive(:kcl_builder).with(queue).and_return(stub_builder)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-kinesis
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.6
5
5
  platform: java
6
6
  authors:
7
7
  - Brian Palmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-11 00:00:00.000000000 Z
11
+ date: 2017-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement