telekinesis 3.1.1-java → 3.2.0-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
  SHA1:
3
- metadata.gz: 6a2b617639b7c4d961e9975d77f103cbb6eefae3
4
- data.tar.gz: e53e8769d24d5e2d37dbb8ee4685813ad070531f
3
+ metadata.gz: 45d793277dd64f3a39dfdabc1039c889a5422368
4
+ data.tar.gz: afc2b0e0c5946fdb9f8ccc4fe941835de015232c
5
5
  SHA512:
6
- metadata.gz: 052a36d2b92ee03ab167a58ec4802e03ad40f194a1fb5dedbf1112b02f269be3c2ab83afbc84e82ce674ee352eb843cdf9f5c1bf83e74ec528816a678bece9e6
7
- data.tar.gz: 5300a0ab04bc03de8a6dd3c4052ae35348dbd62ba292eac7ec10c457129c3896aace2221108986aa0351eec768edf15c10e14c3251e3663f2bf9e2c2c3218edc
6
+ metadata.gz: 16c2df47e454d4336f3a937ede624f84ebbb7ab321b579296edd945f79b6b3ac44eae44bd05299f398714e052db406fd4be86f1f354c648da717d4d6607c6b58
7
+ data.tar.gz: 5c63bd67215e8f6ce2a4f75d3db36e3d945ac0ddb598918c0b1e341691d385595169e9d4315ca12f8fa17140e30e69e42bdd6e5055788a008ba060f9251c97bb
data/README.md CHANGED
@@ -66,7 +66,7 @@ require 'telekinesis'
66
66
  producer = Telekinesis::Producer::SyncProducer.create(
67
67
  stream: 'my stream',
68
68
  credentials: {
69
- acess_key_id: 'foo',
69
+ access_key_id: 'foo',
70
70
  secret_access_key: 'bar'
71
71
  }
72
72
  )
@@ -160,7 +160,7 @@ producer = Telekinesis::Producer::AsyncProducer.create(
160
160
  failure_handler: MyFailureHandler.new,
161
161
  send_every_ms: 1500,
162
162
  credentials: {
163
- acess_key_id: 'foo',
163
+ access_key_id: 'foo',
164
164
  secret_access_key: 'bar'
165
165
  }
166
166
  )
data/ext/pom.xml CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  <groupId>com.kickstarter</groupId>
6
6
  <artifactId>telekinesis</artifactId>
7
- <version>3.1.1</version>
7
+ <version>3.2.0</version>
8
8
 
9
9
  <!-- ================================================================== -->
10
10
  <build>
@@ -1,5 +1,6 @@
1
1
  package com.kickstarter.jruby;
2
2
 
3
+ import com.amazonaws.services.dynamodbv2.AmazonDynamoDB;
3
4
  import com.amazonaws.services.kinesis.clientlibrary.lib.worker.KinesisClientLibConfiguration;
4
5
  import com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker;
5
6
  import com.amazonaws.services.kinesis.clientlibrary.types.InitializationInput;
@@ -33,10 +34,12 @@ import java.util.concurrent.ExecutorService;
33
34
  public class Telekinesis {
34
35
  /**
35
36
  * Create a new KCL {@link Worker} that processes records using the given
36
- * {@link ExecutorService} and {@link IRecordProcessorFactory}.
37
+ * {@link ExecutorService}, {@link IRecordProcessorFactory}, and
38
+ * {@link AmazonDynamoDB}.
37
39
  */
38
40
  public static Worker newWorker(final KinesisClientLibConfiguration config,
39
41
  final ExecutorService executor,
42
+ final AmazonDynamoDB dynamoClient,
40
43
  final IRecordProcessorFactory factory) {
41
44
  com.amazonaws.services.kinesis.clientlibrary.interfaces.v2.IRecordProcessorFactory v2Factory = new com.amazonaws.services.kinesis.clientlibrary.interfaces.v2.IRecordProcessorFactory() {
42
45
  @Override
@@ -49,6 +52,7 @@ public class Telekinesis {
49
52
  .recordProcessorFactory(v2Factory)
50
53
  .config(config)
51
54
  .execService(executor) // NOTE: .execService(null) is a no-op
55
+ .dynamoDBClient(dynamoClient)
52
56
  .build();
53
57
  }
54
58
 
@@ -2,7 +2,9 @@ module Telekinesis
2
2
  module Aws
3
3
  java_import java.nio.ByteBuffer
4
4
  java_import com.amazonaws.AmazonClientException
5
+ java_import com.amazonaws.auth.BasicAWSCredentials
5
6
  java_import com.amazonaws.auth.DefaultAWSCredentialsProviderChain
7
+ java_import com.amazonaws.internal.StaticCredentialsProvider
6
8
  java_import com.amazonaws.services.kinesis.AmazonKinesisClient
7
9
  java_import com.amazonaws.services.kinesis.model.PutRecordRequest
8
10
  java_import com.amazonaws.services.kinesis.model.PutRecordsRequest
@@ -23,6 +23,10 @@ module Telekinesis
23
23
  # client in the same `:app` on the same host, make sure you set this to
24
24
  # something unique!).
25
25
  #
26
+ # Clients interested in configuring their own AmazonDynamoDB client may
27
+ # pass an instance as the second argument. If not configured, the client
28
+ # will use a default AWS configuration.
29
+ #
26
30
  # Any other valid KCL Worker `:options` may be passed as a nested hash.
27
31
  #
28
32
  # For example, to configure a `tail` app on `some-stream` and use the
@@ -64,10 +68,10 @@ module Telekinesis
64
68
  #
65
69
  # kcl_worker.run
66
70
  #
67
- def initialize(config, &block)
71
+ def initialize(config, dynamo_client = nil, &block)
68
72
  raise ArgumentError, "No block given!" unless block_given?
69
73
  kcl_config = self.class.build_config(config)
70
- @under = com.kickstarter.jruby.Telekinesis.new_worker(kcl_config, config[:executor], &block)
74
+ @under = com.kickstarter.jruby.Telekinesis.new_worker(kcl_config, config[:executor], dynamo_client, &block)
71
75
  end
72
76
 
73
77
  # Return the underlying KCL worker. It's a java.lang.Runnable.
@@ -1,3 +1,3 @@
1
1
  module Telekinesis
2
- VERSION = '3.1.1'
2
+ VERSION = '3.2.0'
3
3
  end
@@ -68,5 +68,18 @@ class JavaClientAdapterTest < Minitest::Test
68
68
  end
69
69
  end
70
70
  end
71
+
72
+ context ".build_credentials_provider" do
73
+ should "return a provider that provides the specified credentials" do
74
+ credentials = {
75
+ access_key_id: '0000000000',
76
+ secret_access_key: '0000000000',
77
+ }
78
+ provider = Telekinesis::Aws::JavaClientAdapter.build_credentials_provider(credentials)
79
+
80
+ assert_equal(credentials[:access_key_id], provider.credentials.aws_access_key_id)
81
+ assert_equal(credentials[:secret_access_key], provider.credentials.aws_secret_key)
82
+ end
83
+ end
71
84
  end
72
85
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telekinesis
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.2.0
5
5
  platform: java
6
6
  authors:
7
7
  - Ben Linsay
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-28 00:00:00.000000000 Z
11
+ date: 2016-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -106,7 +106,7 @@ files:
106
106
  - test/producer/test_helper.rb
107
107
  - test/producer/test_sync_producer.rb
108
108
  - test/test_helper.rb
109
- - lib/telekinesis/telekinesis-3.1.1.jar
109
+ - lib/telekinesis/telekinesis-3.2.0.jar
110
110
  homepage: https://github.com/kickstarter/telekinesis
111
111
  licenses: []
112
112
  metadata: {}