1.1.0 • Published 6 years ago

kinesis-cycling-readable v1.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

kinesis-cycling-readable

npm.io

Usage

var kinesisRead = require('kinesis-cycling-readable');

var stream = kinesisRead(
  new AWS.Kinesis({region: 'us-east-1'}),
  'stream-name'
});

stream.on('data', function (records) {
});

Upon encountering an ProvisionedThroughputExceededException, the stream will automatically cycle to the next shard in the stream and keep reading.

Options

{
  readpause: 1000, // Milliseconds to wait between `getRecords` calls
  cyclepause: 1000, // Milliseconds to wait after cycling shards
  allowLooping: false, // If true, when the last shard is cycled, start back at the first shard
                       // If false, the stream emits an error when the last shard is exhausted
  iteratorType: 'LATEST', // Type of ShardIterator to request. Must be one of 
                          // TRIM_HORIZON | LATEST | AT_TIMESTAMP
  iteratorTimestamp: null // Timestamp to use for `AT_TIMESTAMP` ShardIterators
}