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

dms-kinesis-gen

v1.6.1

Published

Generate Kinesis Base64 Records, based on JSON Files

Downloads

22

Readme

kinesis-dms-record-generator

Summary

This is simple CLI, to help developers simulate the records that Amazon DMS sends to a kinesis stream, when running Migration Tasks.

The problem

When developers are working with DMS + Kinesis, it's very difficult to simulate the stream locally, therefore, developer's productivity is impaired. This tool aims in improving the developer experience and productivity

The solution

By using tools such as Data Grip, the developer can right-click the table, and export the table content to a JSON File. This tool will feed from this JSON file, and it will automatically generate the Kinesis Record, and use the aws-cli to put the records in the stream

Dependencies

Before using this tool, you must have the following tools configured in your machine

Pattern on filenames

All the files inside the folder should follow the following pattern.

loadOrder.schema.table.json

For example

1.OT.CUSTOMER.json
2.OT.PRODUCTS.json

The bigger the load-order, first it will be loaded, following the same patter from Amazon DMS Docs.

For the example files, the order will be:

2.OT.PRODUCTS.json
1.OT.CUSTOMER.json

The JSON can have a single record, or an array of records, for example:

[
  {
    "ID": 1,
    "NAME": "Joselito Silva"
  }
]

This JSON file will generate the following Kinesis Record

{
  "data": {
    "ID": 1,
    "NAME": "Joselito Silva"
  },
  "metadata": {
    "timestamp": "2021-02-21T23:02:36.5680Z",
    "record-type": "data",
    "operation": "load",
    "partition-key-type": "primary-key",
    "schema-name": "OT",
    "table-name": "CUSTOMER"
  }
}

CLI Options

| Option | Description | Required | Default | | ------- | --- | --- | --- | | -d, --directory | The folder where the JSON files are located | Yes | | | -s, --stream-name | The name of the kinesis stream | Yes | | | -p, --partition-key | The partition key | No | 1 | | -e, --localstack-endpoint | The localstack endpoint | No | http://localhost:4566 | | -o, --operation | The operation* name you want to simulate | No | LOAD | | -b, --batch-size | batch-size for batch processing | No | 1 |

  • *Valid operations: LOAD, INSERT, UPDATE and DELETE
  • *Valid batch sizes: 1 to 500 (AWS limits)

The cli will load all files inside the files folder, and load them to the kinesis stream By default it will load one by one but you can also add the --batch-size to put multiple records in batches

Running as bin

npx dms-kinesis-gen -d C:/Users/my-user/Documents/cdc-files -s my-stream-name

or install it globally with

npm i -g dms-kinesis-gen

And then use the command

dms-kinesis-gen -d C:/Users/my-user/Documents/cdc-files -s my-stream-name

Running Tests

yarn test

Running Lint

yarn lint

# or with fix

yarn lint:fix

Contributing

Check the contributing.md file for more information