Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Minimalistic proof of concept for event-driven architecture (EDA) using NATS

License

Notifications You must be signed in to change notification settings

MGTheTrain/eda-with-nats-poc

Repository files navigation

eda-with-nats-poc

Table of Contents

Summary

Minimalistic proof of concept for event-driven architecture (EDA) using NATS

References

Features

  • Showcase pub-sub messaging trough NATS broker
  • Showcase pub-sub messaging with security mechanisms using TLS for encryption and authentication through a NATS broker

Getting started

Preconditions

Minimalistic setup

  1. Ramp up local Docker Compose cluster:
docker-compose up -d --build
  1. Launch the subscriber application in a terminal process:
cd subscribers/Mgtt.MinimalisticSubscriber
dotnet run
  1. Initiate the publisher application in a separate terminal process:
cd publishers/Mgtt.MinimalisticPublisher
dotnet run
  1. Observe that the subscriber successfully receives the submitted event. Results should resemble the following:

pub-sub-messaging-with-nats-example

  1. Terminate the subscriber application by pressing any key and remove resources of the local Docker Compose cluster:
docker-compose down -v

Setup with TLS encryption and authentiation

  1. Renew cryptographic material (self signed certs and private keys) as outlined in the README.md if necessary due to expiration

  2. Ramp up local Docker Compose cluster:

docker-compose -f docker-compose.nats-with-tls-and-auth.yml up -d --build

The logs within the Docker container should appear similar to the following:

nats-tls-with-auth-docker-logs

  1. Launch the subscriber application in a terminal process:
cd subscribers/Mgtt.SubscriberWithTlsAndAuth
dotnet run
  1. Initiate the publisher application in a separate terminal process:
cd publishers/Mgtt.PublisherWithTlsAndAuth
dotnet run
  1. Observe that the subscriber successfully receives the submitted event. Results should resemble the following:

pub-sub-messaging-with-nats-tls-and-auth-example

  1. Terminate the subscriber application by pressing any key and remove resources of the local Docker Compose cluster:
docker-compose -f docker-compose.nats-with-tls-and-auth.yml down -v

Releases

No releases published

Packages

No packages published

Languages