Skip to content
This repository has been archived by the owner on Mar 30, 2021. It is now read-only.

Commit

Permalink
Upgrade Versions of the Amazon Kinesis Client Library, and AWS SDK (#77)
Browse files Browse the repository at this point in the history
* Upgrade KCL, and AWS SDK

Upgrade the Amazon Kinesis Client Library to 1.7.2, and upgraded the AWS
SDK to 1.11.14.

* Rework Samples to Use Maven

Reworked the samples to use Maven, and create launch scripts in Maven
  • Loading branch information
pfifer authored Nov 14, 2016
1 parent 2315ed5 commit 7597b69
Show file tree
Hide file tree
Showing 49 changed files with 188 additions and 56 deletions.
62 changes: 36 additions & 26 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>amazon-kinesis-connectors</artifactId>
<packaging>jar</packaging>
<name>Amazon Kinesis Connector Library</name>
<version>1.2.0</version>
<version>1.3.0-SNAPSHOT</version>
<description>The Amazon Kinesis Connector Library helps Java developers integrate Amazon Kinesis with other AWS and non-AWS services.</description>
<url>https://aws.amazon.com/kinesis</url>

Expand All @@ -23,10 +23,10 @@
</licenses>

<properties>
<amazon-kinesis-client.version>1.4.0</amazon-kinesis-client.version>
<aws-java-sdk.version>1.9.37</aws-java-sdk.version>
<amazon-kinesis-client.version>1.7.2</amazon-kinesis-client.version>
<aws-java-sdk.version>1.11.14</aws-java-sdk.version>
<elasticsearch.version>1.2.1</elasticsearch.version>
<fasterxml-jackson.version>2.3.2</fasterxml-jackson.version>
<fasterxml-jackson.version>2.6.6</fasterxml-jackson.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -58,12 +58,7 @@
<version>${aws-java-sdk.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>${elasticsearch.version}</version>
<optional>true</optional>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
Expand All @@ -74,6 +69,12 @@
<artifactId>jackson-databind</artifactId>
<version>${fasterxml-jackson.version}</version>
</dependency>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>${elasticsearch.version}</version>
<optional>true</optional>
</dependency>

<!-- Test -->
<dependency>
Expand Down Expand Up @@ -133,23 +134,32 @@
</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>

</build>

<profiles>
<profile>
<id>publish</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>

119 changes: 119 additions & 0 deletions samples/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.amazonaws</groupId>
<artifactId>amazon-kinesis-connectors-samples</artifactId>
<packaging>jar</packaging>
<name>Amazon Kinesis Connector Library Samples</name>
<version>1.0.0-SNAPSHOT</version>
<description>Samples for the Amazon Kinesis Connector Library.</description>
<url>https://aws.amazon.com/kinesis</url>

<scm>
<url>https://github.com/awslabs/amazon-kinesis-connectors.git</url>
</scm>

<licenses>
<license>
<name>Amazon Software License</name>
<url>https://aws.amazon.com/asl</url>
<distribution>repo</distribution>
</license>
</licenses>

<properties>
<kinesis-connector.version>1.3.0-SNAPSHOT</kinesis-connector.version>
<aws-java-sdk.version>1.11.14</aws-java-sdk.version>
</properties>

<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>amazon-kinesis-connectors</artifactId>
<version>${kinesis-connector.version}</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>${aws-java-sdk.version}</version>
</dependency>

<!-- Sample Dependencies -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.3-1101-jdbc41</version>
</dependency>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
<version>4.8.1</version>
</dependency>


</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<version>1.10</version>
<executions>
<execution>
<id>generate-scripts</id>
<phase>package</phase>
<goals>
<goal>assemble</goal>
</goals>
</execution>
</executions>
<configuration>
<programs>
<program>
<mainClass>samples.dynamodb.DynamoDBExecutor</mainClass>
<id>dynamodb-sample</id>
</program>
<program>
<mainClass>samples.s3.S3Executor</mainClass>
<id>s3-sample</id>
</program>
<program>
<mainClass>samples.elasticsearch.ElasticsearchExecutor</mainClass>
<id>elastic-search-sample</id>
</program>
<program>
<mainClass>samples.redshiftbasic.RedshiftBasicExecutor</mainClass>
<id>redshift-basic-sample</id>
</program>
<program>
<mainClass>samples.redshiftmanifest.RedshiftManifestExecutor</mainClass>
<id>redshift-manifest-sample</id>
</program>
</programs>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

package samples;

import java.io.BufferedReader;
Expand All @@ -30,6 +31,8 @@

import com.amazonaws.services.kinesis.connectors.KinesisConnectorConfiguration;
import com.amazonaws.services.kinesis.model.PutRecordRequest;
import samples.KinesisMessageModel;
import samples.StreamSource;

/**
* This class is a data source for supplying input to the Amazon Kinesis stream. It reads lines from the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Ant build script for compiling and running the Amazon Kinesis Connector to Amazon DynamoDB sample.
Don't forget to fill in your AWS access credentials in AwsCredentials.properties
before trying to run it. -->
<project name="Amazon Kinesis Connector to Amazon DynamoDB Sample" default="run" basedir="../../">
<project name="Amazon Kinesis Connector to Amazon DynamoDB Sample" default="run" basedir="../../../..//">
<property name="src.dir" location="${basedir}/../" />
<property name="kcl.dir" location="${src.dir}/KinesisClientLibrary" />
<property name="external.dir" location="${src.dir}/external" />
Expand All @@ -13,14 +13,14 @@
<fileset dir="${kcl.dir}" includes="**/*.jar" />
<fileset dir="${external.dir}" includes="**/*.jar" />
<pathelement location="${basedir}/build" />
<pathelement location="." />
<pathelement location="${basedir}/samples" />
<pathelement location="${basedir}/samples/dynamodb" />
<pathelement location="../../" />
<pathelement location="/src/main/java/samples" />
<pathelement location="/src/main/java/samples/dynamodb" />
</path>

<target name="clean">
<delete includeEmptyDirs="true" failOnError="false">
<fileset dir="." includes="**/*.class" />
<fileset dir="../../" includes="**/*.class" />
<fileset dir="${basedir}/build"/>
<fileset dir="${kcl.dir}"/>
<fileset dir="${external.dir}"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Ant build script for compiling and running the Amazon Kinesis Connector to Elasticsearch sample.
Don't forget to fill in your AWS access credentials in AwsCredentials.properties
before trying to run it. -->
<project name="Amazon Kinesis Connector to Elasticsearch Sample" default="run" basedir="../../">
<project name="Amazon Kinesis Connector to Elasticsearch Sample" default="run" basedir="../../../..//">
<property name="src.dir" location="${basedir}/../" />
<property name="kcl.dir" location="${src.dir}/KinesisClientLibrary" />
<property name="external.dir" location="${src.dir}/external" />
Expand All @@ -13,14 +13,14 @@
<fileset dir="${kcl.dir}" includes="**/*.jar" />
<fileset dir="${external.dir}" includes="**/*.jar" />
<pathelement location="${basedir}/build" />
<pathelement location="." />
<pathelement location="${basedir}/samples" />
<pathelement location="${basedir}/samples/elasticsearch" />
<pathelement location="../../" />
<pathelement location="/src/main/java/samples" />
<pathelement location="/src/main/java/samples/elasticsearch" />
</path>

<target name="clean">
<delete includeEmptyDirs="true" failOnError="false">
<fileset dir="." includes="**/*.class" />
<fileset dir="../../" includes="**/*.class" />
<fileset dir="${basedir}/build"/>
<fileset dir="${kcl.dir}"/>
<fileset dir="${external.dir}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
before trying to run it.
Please include PostgreSQL driver in the classpath. If you use the download target, this will be done for you.
-->
<project name="Amazon Kinesis Connector to Amazon Redshift Basic Sample" default="run" basedir="../../">
<project name="Amazon Kinesis Connector to Amazon Redshift Basic Sample" default="run" basedir="../../../..//">
<property name="src.dir" location="${basedir}/../" />
<property name="kcl.dir" location="${src.dir}/KinesisClientLibrary" />
<property name="external.dir" location="${src.dir}/external" />
Expand All @@ -15,14 +15,14 @@
<fileset dir="${kcl.dir}" includes="**/*.jar" />
<fileset dir="${external.dir}" includes="**/*.jar" />
<pathelement location="${basedir}/build" />
<pathelement location="." />
<pathelement location="${basedir}/samples" />
<pathelement location="${basedir}/samples/redshiftbasic" />
<pathelement location="../../" />
<pathelement location="/src/main/java/samples" />
<pathelement location="/src/main/java/samples/redshiftbasic" />
</path>

<target name="clean">
<delete includeEmptyDirs="true" failOnError="false">
<fileset dir="." includes="**/*.class" />
<fileset dir="../../" includes="**/*.class" />
<fileset dir="${basedir}/build"/>
<fileset dir="${kcl.dir}"/>
<fileset dir="${external.dir}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
before trying to run it.
Please include PostgreSQL driver in the classpath. If you use the download target, this will be done for you.
-->
<project name="Amazon Kinesis Connector to Amazon Redshift Manifest Sample" default="run" basedir="../../">
<project name="Amazon Kinesis Connector to Amazon Redshift Manifest Sample" default="run" basedir="../../../..//">
<property name="src.dir" location="${basedir}/../" />
<property name="kcl.dir" location="${src.dir}/KinesisClientLibrary" />
<property name="external.dir" location="${src.dir}/external" />
Expand All @@ -15,14 +15,14 @@
<fileset dir="${kcl.dir}" includes="**/*.jar" />
<fileset dir="${external.dir}" includes="**/*.jar" />
<pathelement location="${basedir}/build" />
<pathelement location="." />
<pathelement location="${basedir}/samples" />
<pathelement location="${basedir}/samples/redshiftmanifest" />
<pathelement location="../../" />
<pathelement location="/src/main/java/samples" />
<pathelement location="/src/main/java/samples/redshiftmanifest" />
</path>

<target name="clean">
<delete includeEmptyDirs="true" failOnError="false">
<fileset dir="." includes="**/*.class" />
<fileset dir="../../" includes="**/*.class" />
<fileset dir="${basedir}/build"/>
<fileset dir="${kcl.dir}"/>
<fileset dir="${external.dir}"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Ant build script for compiling and running the Amazon Kinesis Connector to Amazon S3 sample.
Don't forget to fill in your AWS access credentials in AwsCredentials.properties
before trying to run it. -->
<project name="Amazon Kinesis Connector to Amazon S3 Sample" default="run" basedir="../../">
<project name="Amazon Kinesis Connector to Amazon S3 Sample" default="run" basedir="../../../..//">
<property name="src.dir" location="${basedir}/../" />
<property name="kcl.dir" location="${src.dir}/KinesisClientLibrary" />
<property name="external.dir" location="${src.dir}/external" />
Expand All @@ -13,14 +13,14 @@
<fileset dir="${kcl.dir}" includes="**/*.jar" />
<fileset dir="${external.dir}" includes="**/*.jar" />
<pathelement location="${basedir}/build" />
<pathelement location="." />
<pathelement location="${basedir}/samples" />
<pathelement location="${basedir}/samples/s3" />
<pathelement location="../../" />
<pathelement location="/src/main/java/samples" />
<pathelement location="/src/main/java/samples/s3" />
</path>

<target name="clean">
<delete includeEmptyDirs="true" failOnError="false">
<fileset dir="." includes="**/*.class" />
<fileset dir="../../" includes="**/*.class" />
<fileset dir="${basedir}/build"/>
<fileset dir="${kcl.dir}"/>
<fileset dir="${external.dir}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bufferMillisecondsLimit = 3600000

# Amazon S3 parameters for KinesisConnector
# Please fill in the name of Amazon S3 bucket you'd like to use.
s3Bucket =
s3Bucket = pfifer-connector-test
s3Endpoint = https\://s3.amazonaws.com

# Optional Amazon S3 parameters for automatically creating the bucket
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import com.amazonaws.services.kinesis.clientlibrary.exceptions.ThrottlingException;
import com.amazonaws.services.kinesis.clientlibrary.interfaces.IRecordProcessor;
import com.amazonaws.services.kinesis.clientlibrary.interfaces.IRecordProcessorCheckpointer;
import com.amazonaws.services.kinesis.clientlibrary.types.ShutdownReason;
import com.amazonaws.services.kinesis.clientlibrary.lib.worker.ShutdownReason;
import com.amazonaws.services.kinesis.model.Record;

/**
Expand Down
Loading

0 comments on commit 7597b69

Please sign in to comment.