Skip to content

Phathdt/mongo-streamer

Repository files navigation

mongo-streamer: Golang streaming change from Mongodb to Nats jetstream

Getting Started

Use the following guide to get started with mongo-streamer on your machine.

Requirements

  1. Golang
  2. Nats
  3. Mongodb

Installation

  1. Clone the project from the repository:
git clone https://github.com/phathdt/mongo-streamer.git
cd mongo-streamer
  1. Install dependencies:
go mod tidy
  1. Set up configurations in the .env file. Change the values to reflect your configuration:
APP_ENV="dev"
COLLECTION_NAME=demo-collection
DB_NAME=demo-database
FIBER_PORT=4000
LOG_LEVEL="trace"
SUBJECT=demo
FullDocumentBeforeChange="true" # only available for mongodb 6.0
MONGO_URI="mongodb://localhost:27017"
NATS_SUB_URI="nats://localhost:4222"
  1. Create a jetstream in nats
nats str add demo --config examples/demo.json
  1. Run the service:
task mongo-streamer
  1. The project will run at http://localhost:4000.

Contribution

We welcome contributions from the community. If you wish to contribute, please read the Contribution Guide.

Release Notes

See Changelog for details about versions and updates.

Author

License

The project is distributed under the MIT License - See the LICENSE file for details.

Contact

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published