aws-samples/amazon-kinesis-socket-server-sample

Name: amazon-kinesis-socket-server-sample

Owner: AWS Samples

Description: Sample Java application that uses the Amazon Kinesis Client Library to read a Kinesis Data Stream and output data records to connected clients over a TCP socket.

Created: 2018-04-24 18:15:09.0

Updated: 2018-05-10 14:53:41.0

Pushed: 2018-04-27 20:30:07.0

Homepage: null

Size: 15

Language: Java

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Amazon Kinesis Socket Server Sample

Sample Java application that uses the Amazon Kinesis Client Library to read a Kinesis Data Stream and output data records to connected clients over a TCP socket.

This sample application uses the Amazon Kinesis Client Library (KCL) example application described here as a starting point. The application implements the V2 KCL interface.

Data records are sent to connected clients as UTF8 encoded JSON strings.

Requirements & Prerequisites
Maven

This application requires Maven to download dependancies and build. The application can be built by

package
AWS Credentials File

This application uses AWS IAM programatic access credentials stored in a file calls Credentials in a directory within user's home directory ~/.aws/. The file must contain the following lines.

ault]
access_key_id = <your access key id>
secret_access_key = <your secret key>
IAM Security Policy

The IAM user credentials stored in the Credentials file must have the following permissions.

Amazon Kinesis
sis:GetShardIterator
sis:DescribeStream
sis:ListTagsForStream
sis:GetRecords

(specific to Kinesis Data Stream that is being read as the target resource)

Amazon DynamoDB
modb:BatchGetItem
modb:BatchWriteItem
modb:PutItem
modb:DeleteItem
modb:Scan
modb:Query
modb:UpdateItem
modb:DeleteTable
modb:CreateTable
modb:DescribeTable
modb:GetItem
modb:UpdateTable
modb:GetRecords

(specify all tables as the target resource)

Usage
  1. Edit the ServerBootstrap.java class to include the name of your Kinesis Data Stream in the SAMPLE_APPLICATION_STREAM_NAME variable

  2. Edit the ServerBootstrap.java class to include a name for the application in the the SAMPLE_APPLICATION_NAME variable.

  3. Build the project

License Summary

This sample code is made available under a modified MIT license. See the LICENSE file.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.