Skip to content

This project is a resilient data service that retrieves, stores, and displays order data from a nats-streaming channel using PostgreSQL and in-memory caching.

License

Notifications You must be signed in to change notification settings

elevante/NATS-orderStream-service

Repository files navigation

NATS-orderStream-service

Golang HTML Makefile

Description

NATS-orderStream-service is a Go service that processes order data. The service connects and subscribes to a channel in nats-streaming, writes the received data to a PostgreSQL database, and caches them in-memory. In case of service failure, the cache is restored from the database. The service also launches an HTTP server that outputs data by id from the cache.

Installation and Launch

The project uses Docker and Makefile to simplify the installation and launch process. Here are the main commands:

# Building Docker images
make build

# Launching Docker containers
make up

# After launching Docker Compose, manually run 'model.sql' to create the necessary tables

# Running the Go service
make run

# Stopping Docker containers
make down

Usage

After launching the service, you can get order data using its id. Just go to the following URL in your browser:

http://localhost:8080/order?id={id}

where {id} is the order id.

About

This project is a resilient data service that retrieves, stores, and displays order data from a nats-streaming channel using PostgreSQL and in-memory caching.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages