Skip to content

Distributed notification micro-service using nats jetstream with distributed tracing using open-Telemetry.

Notifications You must be signed in to change notification settings

sourikghosh/notif

Repository files navigation

CodeQL Lint Checker Build

NOTIF

Notif is a distributed notification micro-service. Its build using Nats JetStream which serves as a distributed workQueue and consumes the event with a pull based consumer.The pull subscriber actually pulls event from stream which means its can be scaled horizontally very easily. The pull-subscriber fetch events in batchs which can be configured.
Notif also has instrumentation support for distributed tracing for observability which is key for async transactions using Open Telemetry, B3 as propagator, and Jaeger as exporter.

Diagram

Prerequisite

  • a smtp server / enable smtp service on your email
  • docker and go installed

Installation

  • git@github.com:sourikghosh/notif.git
  • cd notif
  • go mod downlaod
  • make js
  • make trace
  • make server

Mode

Email

Currently the Mode of Notification is only email. Email is sent using go standard lib smtp package.
Notif does not provide a SMTP server it takes few required credentials to create a secured TLS smtp client connection if possible to send emails.
Email accept all possible content-type so you can send from beautiful htmls to basic plain/text. For examples refer to example

Enpoints

Notif currently only support rest endpoint to create notification events.
gRPC enpoints are coming soon.

curl --request POST \
  --url http://localhost:6969/notif-svc/v1/create \
  --header 'Content-Type: application/json' \
  --data '{
	"fromName":"Sourik Ghosh",
	"toList":[
		{
			"emailAddr":"someemail@example.com",
			"userName":"some one"
		}
	],
	"subject":"This is the subject",
	"body":"Hi someone, Have a great day !!!"
}'

Jaeger-UI

Then navigate to Jaeger-UI

About

Distributed notification micro-service using nats jetstream with distributed tracing using open-Telemetry.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published