Socket
Book a DemoInstallSign in
Socket

@shutterstock/kinesis-helpers

Package Overview
Dependencies
Maintainers
4
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shutterstock/kinesis-helpers

Helper classes for `@aws-sdk/client-kinesis`

1.0.15
latest
Source
npmnpm
Version published
Maintainers
4
Created
Source

npm (scoped) License: MIT API Docs Build - CI Package and Publish Publish Docs

Overview

Helper classes for the AWS v3 SDK for JS Kinesis Client (@aws-sdk/client-kinesis).

KinesisRetrier will retry failed records with a "successful" PutRecordsCommand that has items marked as failed within the response, which then need to be retried.

KinesisBackgroundWriter will accept writes immediately if there is a concurrent writer slot available, and will block the caller until a slot becomes available if all slots are in use.

Getting Started

Installation

The package is available on npm as @shutterstock/kinesis-helpers

npm i @shutterstock/kinesis-helpers

Importing

import { KinesisBackgroundWriter, KinesisRetrier } from '@shutterstock/kinesis-helpers';

API Documentation

After installing the package, you might want to look at our API Documentation to learn about all the features available.

Features

  • KinesisRetrier
    • Kinesis batch put retrier
    • Batch puts return a list of items that were throttled
    • The batch is marked as succeeded (200 status code) even though items failed
    • As a result, the built-in AWS SDK retry logic will not retry the items in the batch that were throttle
  • KinesisBackgroundWriter
    • Accepts writes immediately if there is a concurrent writer slot available
    • Blocks the caller until a slot becomes available if all slots are in use
    • Collects and exposes errors so the caller can detect if errors have been happening

Contributing

Setting up Build Environment

  • nvm use
  • npm i
  • npm run build
  • npm run lint
  • npm run test

Running Examples

kinesis-retrier

  • Create Kinesis Data Stream using AWS Console or any other method
    • Example: aws kinesis create-stream --stream-name kinesis-helpers-test-stream --shard-count 1
    • Default name is kinesis-helpers-test-stream
    • 1 shard is sufficient
    • 1 day retention is sufficient
    • No encryption is sufficient
    • On-demand throughput is sufficient
  • npm run example:kinesis-retrier
    • If the stream name was changed: KINESIS_STREAM_NAME=my-stream-name npm run example:kinesis-retrier

kinesis-background-writer

  • Create Kinesis Data Stream using AWS Console or any other method
    • Example: aws kinesis create-stream --stream-name kinesis-helpers-test-stream --shard-count 1
    • Default name is kinesis-helpers-test-stream
    • 1 shard is sufficient
    • 1 day retention is sufficient
    • No encryption is sufficient
    • On-demand throughput is sufficient
  • npm run example:kinesis-background-writer
    • If the stream name was changed: KINESIS_STREAM_NAME=my-stream-name npm run example:kinesis-background-writer

FAQs

Package last updated on 28 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.