Coder Social home page Coder Social logo

rootcss / dynamodb_stream_fetcher Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 9 KB

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

JavaScript 100.00%

dynamodb_stream_fetcher's Introduction

Dynamodb Stream Fetcher

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

(Dynamodb-stream version of Kinesis Stream Fetcher)

(kinesis_stream_fetcher - http://github.com/supersid/kinesis_stream_fetcher)

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 dynamodb_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 DYNAMODB_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 Dynamodb 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 DynamodbStreamFetcher = require('dynamodb_stream_fetcher');
let fetcher = new DynamodbStreamFetcher(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.

dynamodb_stream_fetcher's People

Contributors

rootcss avatar

Watchers

 avatar

Forkers

abhayachauhan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.