npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

kinesis_stream_fetcher

v1.2.0

Published

A client that fetches messages from kinesis streams. Is capable of handling multiple streams with single shards. Creates separate child processes to fetch data. Uses the aws-sdk API to query messages. Built to avoid use of the multilang daemon provided by

Downloads

19

Readme

Kinesis Stream Fetcher

Kinesis Stream Fetcher is a basic library to fetch messages from a Kinesis stream without using the multilang daemon. It works as a simple poller by launching child processes for each stream that needs to be monitored.

Version 1.0.0 supports multiple partitions and launches a process for each paritition. The partitions config is no longer relevant as the information is not directly fetched from Amazon API.

Install

npm install kinesis_stream_fetcher --save

Usage

Before starting development ensure that your AWS configuration parameters are present in your environment under the following variable.

export AWS_ACCESS_KEY_ID="ACCESS_KEY_ID"
export AWS_SECRET_ACCESS_KEY="SECRET_ACCESS_KEY"
export AWS_REGION="ap-southeast-1"
export KINESIS_PARTITION_KEY="sweetcoffee"

Update

Version 1.2.0 includes a backward compatible support for instanceIds. Each instanceId identifies a deployment uniquely, thus allowing you to run multiple instances of Kinesis Stream Fetcher.

This was a bug in the earlier versions where it assumed that the library would be used for a single instance

let streamConfig = {
    instanceId: 'instance-1',
    redisUrl: 'redis://localhost:6379',
    streams: [{
        name: 'development-transaction_events-1',
        partitions: 1
    },{
        name: 'test-transaction_events',
        partitions: 1
    }]
};
const KinesisStreamFetcher = require('kinesis_stream_fetcher');
let fetcher = new KinesisStreamFetcher(streamConfig);
fetcher.on('message', (data) => {
  console.log(data);
})

Description

The consumer expects a redis connection to store the last read state of a stream. The first attempt is always to begin from the start of the stream.