Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Add Configs, tests, related PR#15 #18

Merged
merged 5 commits into from
Aug 18, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 30 additions & 8 deletions src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,29 @@ kinesis {
# Maximum (inclusive): 300000
ConnectTimeout = 6000

# Use a custom Kinesis and CloudWatch endpoint.
# Use a custom CloudWatch endpoint.
# Note this does not accept protocols or paths, only host names or ip addresses. There is no
# way to disable TLS. The KPL always connects with TLS.
# Expected pattern: ^([A-Za-z0-9-\\.]+)?$
# CloudwatchEndpoint =

# Server port to connect to for CloudWatch.
# Default: 443
# Minimum: 1
# Maximum (inclusive): 65535
# CloudwatchPort =

# This has no effect on Windows.
# If set to true, the KPL native process will attempt to raise its own core file size soft
# limit to 128MB, or the hard limit, whichever is lower. If the soft limit is already at or
# above the target amount, it is not changed.
# Note that even if the limit is successfully raised (or already sufficient), it does not
# guarantee that core files will be written on a crash, since that is dependent on operation
# system settings that's beyond the control of individual processes.
# Default: false
EnableCoreDumps = false

# Use a custom Kinesis endpoint.
#
# Mostly for testing use. Note this does not accept protocols or paths, only
# host names or ip addresses. There is no way to disable TLS. The KPL always
Expand All @@ -129,6 +151,13 @@ kinesis {
# Expected pattern: ^([A-Za-z0-9-\\.]+)?$
# KinesisEndpoint =

# Server port to connect to. Only useful with KinesisEndpoint.
#
# Default: 443
# Minimum: 1
# Maximum (inclusive): 65535
KinesisPort = 443

# If true, throttled puts are not retried. The records that got throttled
# will be failed immediately upon receiving the throttling error. This is
# useful if you want to react immediately to any throttling without waiting
Expand Down Expand Up @@ -236,13 +265,6 @@ kinesis {
# Maximum (inclusive): 16
MinConnections = 1

# Server port to connect to. Only useful with KinesisEndpoint.
#
# Default: 443
# Minimum: 1
# Maximum (inclusive): 65535
KinesisPort = 443

# Limits the maximum allowed put rate for a shard, as a percentage of the
# backend limits.
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class KinesisConsumerSpec
| kcl {
| AWSCredentialsProvider = EnvironmentVariableCredentialsProvider
| regionName = us-east-1
| KinesisEndpoint = "CustomKinesisEndpoint"
| }
| }
|
Expand Down Expand Up @@ -132,6 +133,8 @@ class KinesisConsumerSpec
"TestSpec-test-kinesis-reliability"
)
consumerConf.kclConfiguration.getStreamName should be("test-kinesis-reliability")
consumerConf.kclConfiguration
.getKinesisEndpoint() should be("CustomKinesisEndpoint") //validate an override property

val credentialsProvider = consumerConf.kclConfiguration.getKinesisCredentialsProvider
.asInstanceOf[AWSCredentialsProviderChain]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ class KinesisProducerActorSpec
|
| kpl {
| Region = us-east-1
| KinesisEndpoint = "CustomKinesisEndpoint"
| KinesisPort = 1111
| CloudwatchEndpoint = "CustomCloudWatchEndpoint"
| CloudwatchPort = 2222
| EnableCoreDumps = true
| }
| }
|}
Expand All @@ -81,8 +86,13 @@ class KinesisProducerActorSpec
val producerConf = ProducerConf(kinesisConfig, "testProducer")

producerConf.dispatcher should be(Some("kinesis.akka.default-dispatcher"))
producerConf.kplConfig.getString("Region") should be("us-east-1") //validate an override properly
producerConf.kplConfig.getBoolean("AggregationEnabled") should be(true) //validate a default property
producerConf.kplConfig.getString("Region") should be("us-east-1") //validate an override properly
producerConf.kplConfig.getBoolean("AggregationEnabled") should be(true) //validate a default property
producerConf.kplConfig.getString("KinesisEndpoint") should be("CustomKinesisEndpoint") //validate an override property
producerConf.kplConfig.getInt("KinesisPort") should be(1111) //validate an override property
producerConf.kplConfig.getString("CloudwatchEndpoint") should be("CustomCloudWatchEndpoint") //validate an override property
producerConf.kplConfig.getInt("CloudwatchPort") should be(2222) //validate an override property
producerConf.kplConfig.getBoolean("EnableCoreDumps") should be(true) //validate an override property
producerConf.throttlingConf.get.maxOutstandingRequests should be(50000)
producerConf.throttlingConf.get.retryDuration should be(100.millis)
producerConf.streamName should be("core-test-kinesis-producer")
Expand Down