https://github.com/litsynp/kinesis-js-practice
Send and get real time data with AWS Kinesis with JavaScript.
https://github.com/litsynp/kinesis-js-practice
aws javascript kinesis
Last synced: 2 months ago
JSON representation
Send and get real time data with AWS Kinesis with JavaScript.
- Host: GitHub
- URL: https://github.com/litsynp/kinesis-js-practice
- Owner: litsynp
- Created: 2022-10-24T02:19:26.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-18T12:00:49.000Z (over 3 years ago)
- Last Synced: 2025-05-17T07:07:05.035Z (about 1 year ago)
- Topics: aws, javascript, kinesis
- Language: JavaScript
- Homepage:
- Size: 51.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Kinesis JS Practice
Play with your AWS Kinesis stream with JavaScript.
## Requirements
- AWS CLI installed and your credentials set up properly.
- node
## How to use
### Set Up
Make sure you have correct AWS profile activated.
```bash
$ export AWS_PROFILE=default
```
When running the below scripts, you can inject _environment variables_ like this.
```bash
$ KINESIS_STREAM=litsynp-test-stream-dev AWS_REGION=ap-northeast-1 npm run publish-events hello 1
```
### Publish to Stream (PutRecord)
Push test data to stream with `publish-events`.
```bash
$ npm run publish-events [data] [iteration]
```
- `data` - string data to put as record (default: `Hello World!`)
- `iteration` - the number of times you want to send the data (default: `1`)
### Get Records
Retrieve the data you sent to the Kinesis stream.
```bash
$ npm run get-records [shard-id]
```
- `shard-id` - The [ShardID](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_Shard.html). (default: `0`)
## References
For more information about AWS CLI and injecting environment variables, refer to these links:
- https://docs.litsynp.com/archives/aws/aws-cli
- https://docs.litsynp.com/archives/js-ts/misc/environment-variables