I’ve been working on an application to read data from a Kinesis using the Kinesis Client Library for Java. One requirement was to be able to run the application locally during development. This requires configuring Kinesis, DynamoDB, and CloudWatch to work locally.


Getting a local copy of DynamoDB running is easily done using the dynalite library.

> npm install -g dynalite
> dynalite --port 7000


A local copy of Kinesis is found with the kinesalite library.

> npm install -g kinesalite
> kinesalite --port 7001

Configuring the application

With both dynalite and kinesalite running, it’s time to configure our application to use them. This is done by instantiating AmazonDynamoDBClient and AmazonKinesisClient objects with local end-points. You also need to use an instance of NullMetricsFactory to disable CloudWatch reporting while running locally.

void main(String[] args) throws Exception {

    AmazonDynamoDB dynamoClient = new AmazonDynamoDBClient();

    AmazonKinesis kinesisClient = new AmazonKinesisClient();

    KinesisClientLibConfiguration config =
            new KinesisClientLibConfiguration("my-app", "my-stream", credentialsProvider, "my-worker")

    final Worker worker = new Worker.Builder()
            .recordProcessorFactory(new DruidRecordProcessorFactory())
            .metricsFactory(new NullMetricsFactory())