Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the Java dependencies #165

Merged
merged 3 commits into from
Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,9 @@ In this release, we have abstracted these implementation details away and expose


## Release Notes
### Release 2.2.0 (September 15, 2022)
* [PR #165](https://github.com/awslabs/amazon-kinesis-client-nodejs/pull/165) Update Java dependencies
* KCL and KCL-multilang are updated to the latest version 2.4.13

### Release 2.1.0 (January 31, 2020)
[Milestone #4](https://github.com/awslabs/amazon-kinesis-client-nodejs/milestone/4)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "aws-kcl",
"description": "Kinesis Client Libray (KCL) in Node.js.",
"version": "2.1.0",
"version": "2.2.0",
"author": {
"name": "Amazon Web Services",
"url": "http://aws.amazon.com/"
Expand Down Expand Up @@ -39,7 +39,7 @@
"ink-docstrap": "^1.3.2",
"log4js": "^6.3.0",
"mocha": "^9.1.3",
"sinon": "^12.0.1"
"sinon": "^14.0.0"
},
"homepage": "https://github.com/awslabs/amazon-kinesis-client-nodejs",
"repository": {
Expand Down
26 changes: 13 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
<awssdk.version>2.17.100</awssdk.version>
<aws-java-sdk.version>1.12.3</aws-java-sdk.version>
<netty.version>4.1.72.Final</netty.version>
<netty-reactive.version>2.0.5</netty-reactive.version>
<fasterxml-jackson.version>2.13.1</fasterxml-jackson.version>
<logback.version>1.2.10</logback.version>
<awssdk.version>2.17.268</awssdk.version>
<aws-java-sdk.version>1.12.296</aws-java-sdk.version>
<netty.version>4.1.77.Final</netty.version>
<netty-reactive.version>2.0.6</netty-reactive.version>
<fasterxml-jackson.version>2.13.4</fasterxml-jackson.version>
<logback.version>1.3.0</logback.version>
</properties>
<dependencies>
<dependency>
<groupId>software.amazon.kinesis</groupId>
<artifactId>amazon-kinesis-client-multilang</artifactId>
<version>2.3.9</version>
<version>2.4.3</version>
</dependency>
<dependency>
<groupId>software.amazon.kinesis</groupId>
<artifactId>amazon-kinesis-client</artifactId>
<version>2.3.9</version>
<version>2.4.3</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
Expand Down Expand Up @@ -228,7 +228,7 @@
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.17.1</version>
<version>3.21.5</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand All @@ -241,9 +241,9 @@
<version>1.7.32</version>
</dependency>
<dependency>
<groupId>io.reactivex.rxjava2</groupId>
<groupId>io.reactivex.rxjava3</groupId>
<artifactId>rxjava</artifactId>
<version>2.2.21</version>
<version>3.1.5</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
Expand Down Expand Up @@ -298,7 +298,7 @@
<dependency>
<groupId>software.amazon.glue</groupId>
<artifactId>schema-registry-serde</artifactId>
<version>1.1.8</version>
<version>1.1.13</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
Expand All @@ -318,7 +318,7 @@
<dependency>
<groupId>com.beust</groupId>
<artifactId>jcommander</artifactId>
<version>1.72</version>
<version>1.82</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
Expand Down
3 changes: 2 additions & 1 deletion test/kcl/action_handler_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ SPDX-License-Identifier: Apache-2.0

var chai = require('chai');
var expect = chai.expect;
var should = chai.should();
var sinon = require('sinon');
var util = require('util');

Expand Down Expand Up @@ -78,7 +79,7 @@ describe('action_handler_tests', function() {

it('should write action to stdout', function(done) {
actionHandler.sendAction({action : 'initialize', shardId : 'shardId-000001'}, function(err) {
expect(err).to.be.undefined();
should.equal(err, undefined);
expect(stdoutHook.readLast()).to.equal('{"action":"initialize","shardId":"shardId-000001"}');
done();
});
Expand Down
21 changes: 10 additions & 11 deletions test/kcl/checkpointer_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ SPDX-License-Identifier: Apache-2.0
'use strict';


var chai = require('chai');
var expect = require('chai').expect;
var sinon = require('sinon');
var util = require('util');

var Checkpointer = require('../../lib/kcl/checkpointer');
var KCLManager = require('../../lib/kcl/kcl_manager');
Expand All @@ -24,7 +22,7 @@ describe('checkpointer_tests', function() {
});

beforeEach(function() {
sandbox = sinon.sandbox.create();
sandbox = sinon.createSandbox();
});

afterEach(function() {
Expand All @@ -38,37 +36,37 @@ describe('checkpointer_tests', function() {
it('should emit a checkpoint action and consume response action', function(done) {
var seq = Math.floor((Math.random() * 1000000)).toString();
// Mock KCLManager checkpoint and short-circuit dummy response.
sandbox.stub(kclManager, 'checkpoint', function(seq) {
sandbox.stub(kclManager, 'checkpoint').callsFake(function(seq) {
checkpointer.onCheckpointerResponse(null, seq);
});

checkpointer.checkpoint(seq, function(err, seq) {
expect(err).to.be.null();
expect(err).to.be.equal(null);
done();
});
});

it('should emit a checkpoint action and consume response when no sequence number', function(done) {
sandbox.stub(kclManager, 'checkpoint', function(seq) {
expect(seq).to.be.null();
sandbox.stub(kclManager, 'checkpoint').callsFake(function(seq) {
expect(seq).to.be.equal(null);
checkpointer.onCheckpointerResponse(null, seq);
});

checkpointer.checkpoint(function(err) {
expect(err).to.be.null();
expect(err).to.be.equal(null);
done();
});
});

it('should raise an error when error is received from MultiLangDaemon', function(done) {
var seq = Math.floor((Math.random() * 1000000)).toString();
// Mock KCLManager checkpoint and short-circuit dummy response.
sandbox.stub(kclManager, 'checkpoint', function(seq) {
sandbox.stub(kclManager, 'checkpoint').callsFake(function(seq) {
checkpointer.onCheckpointerResponse('ThrottlingException', seq);
});

checkpointer.checkpoint(seq, function(err) {
expect(err).not.to.be.null();
expect(err).not.to.be.equal(null);
expect(err).to.equal('ThrottlingException');
done();
});
Expand All @@ -77,8 +75,9 @@ describe('checkpointer_tests', function() {
it('should raise an error on checkpoint when previous checkpoint is not complete', function(done) {
var seq = Math.floor((Math.random() * 1000000)).toString();
// Mock KCLManager checkpoint to have outstanding checkpoint.
sandbox.stub(kclManager, 'checkpoint', function(seq) {
sandbox.stub(kclManager, 'checkpoint').callsFake(function(seq) {
});

checkpointer.checkpoint(seq, function(err) {
});

Expand Down
5 changes: 3 additions & 2 deletions test/kcl/io_handler_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ SPDX-License-Identifier: Apache-2.0

var chai = require('chai');
var expect = chai.expect;
var should = chai.should();
var sinon = require('sinon');
var util = require('util');

Expand Down Expand Up @@ -83,10 +84,10 @@ describe('io_handler_tests', function() {
var callback = sinon.spy();
ioHandler.on('line', callback);
process.stdin.emit('data', 'line1\n');
expect(callback.calledOnce).to.be.true();
expect(callback.calledOnce).to.be.equal(true);
ioHandler.destroy();
process.stdin.emit('data', 'line2\n');
expect(callback.calledTwice).to.be.false();
expect(callback.calledTwice).to.be.equal(false);
ioHandler.removeListener('line', callback);
done();
});
Expand Down
30 changes: 14 additions & 16 deletions test/kcl/kcl_process_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@

'use strict';

var chai = require('chai');
var expect = require('chai').expect;
var sinon = require('sinon');
var util = require('util');

var kcl = require('../..');

Expand Down Expand Up @@ -51,28 +49,28 @@ describe('kcl_process_tests', function () {
var sandbox = null;
var kclProcess = null;

var initialize = {action: 'initialize', shardId: 'shardId-000000000001'};
var initialize = { action: 'initialize', shardId: 'shardId-000000000001' };
var initializeString = JSON.stringify(initialize) + '\n';
var initializeResponse = JSON.stringify({action: 'status', responseFor: initialize.action});
var initializeResponse = JSON.stringify({ action: 'status', responseFor: initialize.action });

var processRecords = {
action: 'processRecords',
records: [{'data': 'bWVvdw==', 'partitionKey': 'cat', 'sequenceNumber': '456'}]
records: [{ 'data': 'bWVvdw==', 'partitionKey': 'cat', 'sequenceNumber': '456' }]
};
var processRecordsString = JSON.stringify(processRecords) + '\n';
var processRecordsResponse = JSON.stringify({action: 'status', responseFor: processRecords.action});
var processRecordsResponse = JSON.stringify({ action: 'status', responseFor: processRecords.action });

var checkpoint = {action: 'checkpoint', sequenceNumber: '456'};
var checkpoint = { action: 'checkpoint', sequenceNumber: '456' };
var checkpointString = JSON.stringify(checkpoint);
var checkpointResponse = JSON.stringify({action: checkpoint.action, checkpoint: checkpoint.sequenceNumber}) + '\n';
var checkpointResponse = JSON.stringify({ action: checkpoint.action, checkpoint: checkpoint.sequenceNumber }) + '\n';

var shardEnded = {action: 'shardEnded'};
var shardEnded = { action: 'shardEnded' };
var shardEndedString = JSON.stringify(shardEnded) + '\n';
var shardEndedResponse = JSON.stringify({action: 'status', responseFor: shardEnded.action});
var shardEndedResponse = JSON.stringify({ action: 'status', responseFor: shardEnded.action });

beforeEach(function () {
kclProcess = kcl(new RecordProcessor());
sandbox = sinon.sandbox.create();
sandbox = sinon.createSandbox();
});

afterEach(function () {
Expand All @@ -82,7 +80,7 @@ describe('kcl_process_tests', function () {

it('should initialize kcl and send back response', function (done) {
// Since we can't know when run() would finish processing all inputs, creating a stub for last call in the chain to force verification.
sandbox.stub(kclProcess._kclManager._actionHandler, 'sendAction', function (data, callback) {
sandbox.stub(kclProcess._kclManager._actionHandler, 'sendAction').callsFake(function (data, callback) {
let dataString = JSON.stringify(data);
console.log('Got response: ' + dataString);
callback();
Expand All @@ -97,7 +95,7 @@ describe('kcl_process_tests', function () {
});

it('should process records, checkpoint and then send back response', function (done) {
sandbox.stub(kclProcess._kclManager._actionHandler, 'sendAction', function (data, callback) {
sandbox.stub(kclProcess._kclManager._actionHandler, 'sendAction').callsFake(function (data, callback) {
let dataString = JSON.stringify(data);
console.log('Got response: ' + dataString);
callback();
Expand All @@ -121,7 +119,7 @@ describe('kcl_process_tests', function () {
});

it('should invoke shardEnd and send back response', function (done) {
sandbox.stub(kclProcess._kclManager._actionHandler, 'sendAction', function (data, callback) {
sandbox.stub(kclProcess._kclManager._actionHandler, 'sendAction').callsFake(function (data, callback) {
let dataString = JSON.stringify(data);
console.log('Got response: ' + dataString);
expect(dataString).to.equal(shardEndedResponse);
Expand All @@ -135,7 +133,7 @@ describe('kcl_process_tests', function () {

it('should process Initialize, one or more processRecords and shutdown in order', function (done) {
// Since we can't know when run() would finish processing all inputs, creating a stub for last call in the chain to force verification !
sandbox.stub(kclProcess._kclManager._actionHandler, 'sendAction', function (data, callback) {
sandbox.stub(kclProcess._kclManager._actionHandler, 'sendAction').callsFake(function (data, callback) {
let dataString = JSON.stringify(data);
console.log('Got response: ' + dataString);
callback();
Expand Down Expand Up @@ -175,7 +173,7 @@ describe('kcl_process_tests', function () {

it('should process checkpoint error from MultiLangDaemon', function (done) {
// Since we can't know when run() would finish processing all inputs, creating a stub for last call in the chain to force verification !
sandbox.stub(kclProcess._kclManager._actionHandler, 'sendAction', function (data, callback) {
sandbox.stub(kclProcess._kclManager._actionHandler, 'sendAction').callsFake(function (data, callback) {
let dataString = JSON.stringify(data);
console.log('Got response: ' + dataString);
callback();
Expand Down