Novices Performing Miracles

npm

Need private packages and team management tools?Check out npm Orgs. »

kinesis-write-stream

1.1.1 • Public • Published

kinesis-write-stream

Kinesis writable stream that buffers up records

build status modules status

npm badge

Usage

Records written to the stream will buffer up until highWaterMark has been reached, or the stream is closed, before writing to Kinesis using putRecords.

Failed items

Failed items will be retried up until options.maxRetries has been reached. The initial timeout before the retry is set in options.retryTimeout and it increases by the fibonnaci sequence.

Partition key

The partition key is by default a random number, but this can be adjusted by overriding streamInstance.getPartitionKey(record).

Flushing

Its also possible to send in the option flushTimeout to indicate that the items currently in the buffer should be flushed after the given amount of milliseconds if the highWaterMark haven't been reached.

Logging

A bunyan, winston or similar logger instance that have methods like debug, error and info may be sent in as options.logger to the constructor.

Example

var KinesisWritable = require('kinesis-write-stream');
 
var stream = new KinesisWritable(kinesisClient, 'streamName', {
  highWaterMark: 16,
  maxRetries: 3,
  retryTimeout: 100
});
 
inputStream.pipe(stream);

API

See api.md.

License

MIT

install

npm i kinesis-write-stream

Downloadsweekly downloads

20

version

1.1.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
Report a vulnerability