Skip to content

Commit fbfd74d

Browse files
authored
Release v3.0.0 (#1392)
1 parent a159fa3 commit fbfd74d

File tree

211 files changed

+22029
-3671
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+22029
-3671
lines changed

CHANGELOG.md

+35-625
Large diffs are not rendered by default.

README.md

+56-23
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,38 @@
11
# Amazon Kinesis Client Library for Java
22
[![Build Status](https://travis-ci.org/awslabs/amazon-kinesis-client.svg?branch=master)](https://travis-ci.org/awslabs/amazon-kinesis-client)
33

4-
The **Amazon Kinesis Client Library for Java** (Amazon KCL) enables Java developers to easily consume and process data from [Amazon Kinesis][kinesis].
4+
The **Amazon Kinesis Client Library (KCL) for Java** enables Java developers to easily consume and process data from [Amazon Kinesis Data Streams][kinesis].
55

6-
* [Kinesis Product Page][kinesis]
7-
* [Forum][kinesis-forum]
6+
* [Kinesis Data Streams Product Page][kinesis]
7+
* [Amazon re:Post Forum: Kinesis][kinesis-forum]
88
* [Javadoc][kcl-javadoc]
99
* [FAQ](docs/FAQ.md)
10-
* [KCL Documentation](docs/) (folder)
10+
* [Developer Guide - Kinesis Client Library][kcl-aws-doc]
11+
* [KCL GitHub documentation](docs/) (folder)
1112
* [Issues][kinesis-client-library-issues]
12-
13-
### Recommended Upgrade for All Users of the 1.x Amazon Kinesis Client
14-
:warning: We recommend customers to migrate to 1.14.1 or newer to avoid [known bugs](https://github.com/awslabs/amazon-kinesis-client/issues/778) in 1.14.0 version
15-
16-
### Recommended Upgrade for All Users of the 2.x Amazon Kinesis Client
17-
**:warning: It's highly recommended for users of version 2.0 of the Amazon Kinesis Client to upgrade to version 2.0.3 or later. A [bug has been](https://github.com/awslabs/amazon-kinesis-client/issues/391) identified in versions prior to 2.0.3 that could cause records to be delivered to the wrong record processor.**
18-
19-
**:information_source: Amazon Kinesis Client versions 1.x are not impacted.**
20-
21-
Please open an issue if you have any questions.
13+
* [Giving Feedback][giving-feedback]
2214

2315
## Features
2416

25-
* Provides an easy-to-use programming model for processing data using Amazon Kinesis
26-
* Helps with scale-out and fault-tolerant processing
17+
* **Scalability:** KCL enables applications to scale dynamically by distributing the processing load across multiple workers. You can scale your application in or out, manually or with auto-scaling, without worrying about load redistribution.
18+
* **Load balancing:** KCL automatically balances the processing load across available workers, resulting in an even distribution of work across workers.
19+
* **Checkpointing:** KCL manages checkpointing of processed records, enabling applications to resume processing from their last sucessfully processed position.
20+
* **Fault tolerance:** KCL provides built-in fault tolerance mechanisms, making sure that data processing continues even if individual workers fail. KCL also provides at-least-once delivery.
21+
* **Handling stream-level changes:** KCL adapts to shard splits and merges that might occur due to changes in data volume. It maintains ordering by making sure that child shards are processed only after their parent shard is completed and checkpointed.
22+
* **Monitoring:** KCL integrates with Amazon CloudWatch for consumer-level monitoring.
23+
* **Multi-language support:** KCL natively supports Java and enables multiple non-Java programming languages through MultiLangDaemon.
2724

2825
## Getting Started
2926

3027
1. **Sign up for AWS** — Before you begin, you need an AWS account. For more information about creating an AWS account and retrieving your AWS credentials, see [AWS Account and Credentials][docs-signup] in the AWS SDK for Java Developer Guide.
31-
1. **Sign up for Amazon Kinesis** — Go to the Amazon Kinesis console to sign up for the service and create an Amazon Kinesis stream. For more information, see [Create an Amazon Kinesis Stream][kinesis-guide-create] in the Amazon Kinesis Developer Guide.
32-
1. **Minimum requirements** — To use the Amazon Kinesis Client Library, you'll need **Java 1.8+**. For more information about Amazon Kinesis Client Library requirements, see [Before You Begin][kinesis-guide-begin] in the Amazon Kinesis Developer Guide.
33-
1. **Using the Amazon Kinesis Client Library** — The best way to get familiar with the Amazon Kinesis Client Library is to read [Developing Record Consumer Applications][kinesis-guide-applications] in the Amazon Kinesis Developer Guide.
28+
2. **Sign up for Amazon Kinesis** — Go to the Amazon Kinesis console to sign up for the service and create an Amazon Kinesis stream. For more information, see [Create an Amazon Kinesis Stream][kinesis-guide-create] in the Amazon Kinesis Developer Guide.
29+
3. **Minimum requirements** — To use the Amazon Kinesis Client Library, you will need **Java 1.8+**. For more information about Amazon Kinesis Client Library requirements, see [Before You Begin][kinesis-guide-begin] in the Amazon Kinesis Developer Guide.
30+
4. **Using the Amazon Kinesis Client Library** — The best way to get familiar with the Amazon Kinesis Client Library is to read [Use Kinesis Client Library][kinesis-guide-applications] in the Amazon Kinesis Data Streams Developer Guide. For more information on core KCL concepts, please refer to the [KCL Concepts][kinesis-client-library-concepts] page.
3431

3532
## Building from Source
3633

37-
After you've downloaded the code from GitHub, you can build it using Maven. To disable GPG signing in the build, use
38-
this command: `mvn clean install -Dgpg.skip=true`.
34+
After you have downloaded the code from GitHub, you can build it using Maven. To disable GPG signing in the build, use
35+
this command: `mvn clean install -Dgpg.skip=true`.
3936
Note: This command does not run integration tests.
4037

4138
To disable running unit tests in the build, add the property `-Dskip.ut=true`.
@@ -58,7 +55,17 @@ To make it easier for developers to write record processors in other languages,
5855
## Using the KCL
5956
The recommended way to use the KCL for Java is to consume it from Maven.
6057

58+
### Version 3.x
59+
``` xml
60+
<dependency>
61+
<groupId>software.amazon.kinesis</groupId>
62+
<artifactId>amazon-kinesis-client</artifactId>
63+
<version>3.0.0</version>
64+
</dependency>
65+
```
66+
6167
### Version 2.x
68+
[Version 2.x tracking branch](https://github.com/awslabs/amazon-kinesis-client/tree/v2.x)
6269
``` xml
6370
<dependency>
6471
<groupId>software.amazon.kinesis</groupId>
@@ -77,13 +84,36 @@ The recommended way to use the KCL for Java is to consume it from Maven.
7784
</dependency>
7885
```
7986

87+
> **IMPORTANT**
88+
> We recommend using the latest KCL version for improved performance and support.
89+
8090
## Release Notes
8191

8292
| KCL Version | Changelog |
8393
| --- | --- |
84-
| 2.x | [master/CHANGELOG.md](CHANGELOG.md) |
94+
| 3.x | [master/CHANGELOG.md](CHANGELOG.md) |
95+
| 2.x | [v2.x/CHANGELOG.md](https://github.com/awslabs/amazon-kinesis-client/blob/v2.x/CHANGELOG.md) |
8596
| 1.x | [v1.x/CHANGELOG.md](https://github.com/awslabs/amazon-kinesis-client/blob/v1.x/CHANGELOG.md) |
8697

98+
## Notices
99+
100+
### Recommended Upgrade for All Users of the 1.x Amazon Kinesis Client
101+
We recommend customers to migrate to 1.14.1 or newer to avoid [known bugs](https://github.com/awslabs/amazon-kinesis-client/issues/778) in 1.14.0 version
102+
103+
### Recommended Upgrade for All Users of the 2.x Amazon Kinesis Client
104+
It's highly recommended for users of version 2.0 of the Amazon Kinesis Client to upgrade to version 2.0.3 or later. A [bug has been](https://github.com/awslabs/amazon-kinesis-client/issues/391) identified in versions prior to 2.0.3 that could cause records to be delivered to the wrong record processor.**
105+
106+
## Giving Feedback
107+
108+
Help Us Improve the Kinesis Client Library! Your involvement is crucial to enhancing the Kinesis Client Library. We invite you to join our community and contribute in the following ways:
109+
110+
* [Issue](https://github.com/awslabs/amazon-kinesis-client/issues) Reporting: This is our preferred method of communication. Use this channel to report bugs, suggest improvements, or ask questions.
111+
* Feature Requests: Share your ideas for new features or vote for existing proposals on our [Issues](https://github.com/awslabs/amazon-kinesis-client/issues) page. This helps us prioritize development efforts.
112+
* Participate in Discussions: Engage with other users and our team in our discussion forums.
113+
* Submit [Pull Requests](https://github.com/awslabs/amazon-kinesis-client/pulls): If you have developed a fix or improvement, we welcome your code contributions.
114+
115+
By participating through these channels, you play a vital role in shaping the future of the Kinesis Client Library. We value your input and look forward to collaborating with you!
116+
87117
[docs-signup]: http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/java-dg-setup.html
88118
[kcl-javadoc]: https://javadoc.io/doc/software.amazon.kinesis/amazon-kinesis-client/
89119
[kinesis]: http://aws.amazon.com/kinesis
@@ -98,4 +128,7 @@ The recommended way to use the KCL for Java is to consume it from Maven.
98128
[kinesis-guide-consumer-deaggregation]: http://docs.aws.amazon.com//kinesis/latest/dev/kinesis-kpl-consumer-deaggregation.html
99129
[kclpy]: https://github.com/awslabs/amazon-kinesis-client-python
100130
[multi-lang-protocol]: /amazon-kinesis-client-multilang/src/main/java/software/amazon/kinesis/multilang/package-info.java
101-
[migration-guide]: https://docs.aws.amazon.com/streams/latest/dev/kcl-migration.html
131+
[migration-guide]: https://docs.aws.amazon.com/streams/latest/dev/kcl-migration-from-previous-versions
132+
[kcl-sample]: https://docs.aws.amazon.com/streams/latest/dev/kcl-example-code
133+
[kcl-aws-doc]: https://docs.aws.amazon.com/streams/latest/dev/kcl.html
134+
[giving-feedback]: https://github.com/awslabs/amazon-kinesis-client?tab=readme-ov-file#giving-feedback

amazon-kinesis-client-multilang/pom.xml

+15-32
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,12 @@
2121
<parent>
2222
<artifactId>amazon-kinesis-client-pom</artifactId>
2323
<groupId>software.amazon.kinesis</groupId>
24-
<version>2.6.1-SNAPSHOT</version>
24+
<version>3.0.0</version>
2525
</parent>
2626
<modelVersion>4.0.0</modelVersion>
2727

2828
<artifactId>amazon-kinesis-client-multilang</artifactId>
2929

30-
<properties>
31-
<aws-java-sdk.version>1.12.668</aws-java-sdk.version>
32-
</properties>
33-
3430
<dependencies>
3531
<dependency>
3632
<groupId>software.amazon.kinesis</groupId>
@@ -43,36 +39,10 @@
4339
<version>${awssdk.version}</version>
4440
</dependency>
4541

46-
<dependency>
47-
<groupId>com.amazonaws</groupId>
48-
<artifactId>aws-java-sdk-core</artifactId>
49-
<version>${aws-java-sdk.version}</version>
50-
<exclusions>
51-
<exclusion>
52-
<groupId>com.fasterxml.jackson.core</groupId>
53-
<artifactId>jackson-databind</artifactId>
54-
</exclusion>
55-
<exclusion>
56-
<groupId>com.fasterxml.jackson.dataformat</groupId>
57-
<artifactId>jackson-dataformat-cbor</artifactId>
58-
</exclusion>
59-
<exclusion>
60-
<groupId>org.apache.httpcomponents</groupId>
61-
<artifactId>httpclient</artifactId>
62-
</exclusion>
63-
</exclusions>
64-
</dependency>
65-
66-
<dependency>
67-
<groupId>com.amazonaws</groupId>
68-
<artifactId>aws-java-sdk-sts</artifactId>
69-
<version>${aws-java-sdk.version}</version>
70-
</dependency>
71-
7242
<dependency>
7343
<groupId>org.projectlombok</groupId>
7444
<artifactId>lombok</artifactId>
75-
<version>1.18.24</version>
45+
<version>1.18.28</version>
7646
<scope>provided</scope>
7747
</dependency>
7848
<dependency>
@@ -104,6 +74,12 @@
10474
</dependency>
10575

10676
<!-- Test -->
77+
<dependency>
78+
<groupId>org.junit.jupiter</groupId>
79+
<artifactId>junit-jupiter-api</artifactId>
80+
<version>5.11.3</version>
81+
<scope>test</scope>
82+
</dependency>
10783
<dependency>
10884
<groupId>junit</groupId>
10985
<artifactId>junit</artifactId>
@@ -122,6 +98,13 @@
12298
<version>1.3</version>
12399
<scope>test</scope>
124100
</dependency>
101+
<!-- Using older version to be compatible with Java 8 -->
102+
<dependency>
103+
<groupId>org.mockito</groupId>
104+
<artifactId>mockito-junit-jupiter</artifactId>
105+
<version>3.12.4</version>
106+
<scope>test</scope>
107+
</dependency>
125108
</dependencies>
126109

127110
<build>

amazon-kinesis-client-multilang/src/main/java/software/amazon/kinesis/multilang/MultiLangDaemon.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@
6161
* applicationName = PythonKCLSample
6262
*
6363
* # Users can change the credentials provider the KCL will use to retrieve credentials.
64-
* # The DefaultAWSCredentialsProviderChain checks several other providers, which is
64+
* # The DefaultCredentialsProvider checks several other providers, which is
6565
* # described here:
66-
* # http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/DefaultAWSCredentialsProviderChain.html
67-
* AWSCredentialsProvider = DefaultAWSCredentialsProviderChain
66+
* # https://sdk.amazonaws.com/java/api/2.0.0-preview-11/software/amazon/awssdk/auth/credentials/DefaultCredentialsProvider.html
67+
* AwsCredentialsProvider = DefaultCredentialsProvider
6868
* </pre>
6969
*/
7070
@Slf4j
@@ -141,7 +141,7 @@ void configureLogging(
141141
}
142142
}
143143

144-
String propertiesFile(final MultiLangDaemonArguments arguments) {
144+
String validateAndGetPropertiesFileName(final MultiLangDaemonArguments arguments) {
145145
String propertiesFile = "";
146146

147147
if (CollectionUtils.isNotEmpty(arguments.parameters)) {
@@ -216,9 +216,9 @@ public static void main(final String[] args) {
216216
MultiLangDaemonArguments arguments = new MultiLangDaemonArguments();
217217
JCommander jCommander = daemon.buildJCommanderAndParseArgs(arguments, args);
218218
try {
219-
String propertiesFile = daemon.propertiesFile(arguments);
219+
String propertiesFileName = daemon.validateAndGetPropertiesFileName(arguments);
220220
daemon.configureLogging(arguments.logConfiguration);
221-
MultiLangDaemonConfig config = daemon.buildMultiLangDaemonConfig(propertiesFile);
221+
MultiLangDaemonConfig config = daemon.buildMultiLangDaemonConfig(propertiesFileName);
222222

223223
Scheduler scheduler = daemon.buildScheduler(config);
224224
MultiLangRunner runner = new MultiLangRunner(scheduler);

amazon-kinesis-client-multilang/src/main/java/software/amazon/kinesis/multilang/NestedPropertyKey.java

+9-3
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515
package software.amazon.kinesis.multilang;
1616

1717
import java.util.HashMap;
18+
import java.util.List;
1819
import java.util.Map;
1920

20-
import com.amazonaws.regions.Regions;
2121
import com.google.common.base.CaseFormat;
2222
import lombok.AccessLevel;
2323
import lombok.Getter;
2424
import lombok.extern.slf4j.Slf4j;
25+
import software.amazon.awssdk.regions.Region;
2526

2627
/**
2728
* Key-Value pairs which may be nested in, and extracted from, a property value
@@ -73,8 +74,13 @@ void visit(final NestedPropertyProcessor processor, final String endpoint) {
7374
* @see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-regions">Available Regions</a>
7475
*/
7576
ENDPOINT_REGION {
76-
void visit(final NestedPropertyProcessor processor, final String region) {
77-
processor.acceptEndpointRegion(Regions.fromName(region));
77+
void visit(final NestedPropertyProcessor processor, final String regionName) {
78+
List<Region> validRegions = Region.regions();
79+
Region region = Region.of(regionName);
80+
if (!validRegions.contains(region)) {
81+
throw new IllegalArgumentException("Invalid region name: " + regionName);
82+
}
83+
processor.acceptEndpointRegion(region);
7884
}
7985
},
8086

amazon-kinesis-client-multilang/src/main/java/software/amazon/kinesis/multilang/NestedPropertyProcessor.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
package software.amazon.kinesis.multilang;
1616

17-
import com.amazonaws.regions.Regions;
17+
import software.amazon.awssdk.regions.Region;
1818

1919
/**
2020
* Defines methods to process {@link NestedPropertyKey}s.
@@ -26,11 +26,11 @@ public interface NestedPropertyProcessor {
2626
*
2727
* @param serviceEndpoint the service endpoint either with or without the protocol
2828
* (e.g., https://sns.us-west-1.amazonaws.com, sns.us-west-1.amazonaws.com)
29-
* @param signingRegion the region to use for SigV4 signing of requests (e.g. us-west-1)
29+
* @param signingRegion the region to use for the client (e.g. us-west-1)
3030
*
31-
* @see #acceptEndpointRegion(Regions)
32-
* @see <a href="https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/client/builder/AwsClientBuilder.EndpointConfiguration.html">
33-
* AwsClientBuilder.EndpointConfiguration</a>
31+
* @see #acceptEndpointRegion(Region)
32+
* @see <a href="https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/client/builder/SdkClientBuilder.html#endpointOverride(java.net.URI)">
33+
* AwsClientBuilder.endpointOverride</a>
3434
*/
3535
void acceptEndpoint(String serviceEndpoint, String signingRegion);
3636

@@ -42,7 +42,7 @@ public interface NestedPropertyProcessor {
4242
*
4343
* @see #acceptEndpoint(String, String)
4444
*/
45-
void acceptEndpointRegion(Regions region);
45+
void acceptEndpointRegion(Region region);
4646

4747
/**
4848
* Set the external id, an optional field to designate who can assume an IAM role.

amazon-kinesis-client-multilang/src/main/java/software/amazon/kinesis/multilang/auth/KclSTSAssumeRoleSessionCredentialsProvider.java

-86
This file was deleted.

0 commit comments

Comments
 (0)