Coder Social home page Coder Social logo

copev313 / event-driven-architecture-with-mqtt Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 4 KB

An example project demonstrating MQTT realtime publish-subscribe service communication.

codespaces containerized demo docker mosquitto-mqtt-broker mqtt mqtt-broker poetry pub-sub python

event-driven-architecture-with-mqtt's Introduction

Event-Driven-Architecture-with-MQTT

This repo depicts an example project I found intriguing which demonstrates the use of MQTT for realtime pub-sub communication between several interconnected services. Check out the article for yourself here.


This project's architecture is a collection of five services, all interacting through an MQTT Broker, depicted as a message bus.

  1. Gateway Guardian Service: A service tied to a sensor at a supermarket’s entrance. When a customer enters, and their loyalty card is scanned, the service publishes a ‘CustomerArrival’ event, including the identification from the customer’s loyalty card.

  2. Hello Helper Service: This service is linked to a large display at the supermarket’s entrance. It subscribes to the ‘CustomerArrival’ events. Upon receiving one, it fetches relevant information from its local database using the customer identification received. It then displays a personalized welcome message on the screen.

  3. Gate-exit Guardian Service: Acting as the supermarket’s cash register, this service triggers when a customer passes through the checkout’s detection gates. It automatically scans all items in the customer’s bag and publishes a message on the customer-departed topic, including identifying the purchased items.

  4. Inventory Intel Service: This service subscribes to the topic customer-departed events, adjusting its database to reflect current stock levels. If the stock of a particular item falls below a defined threshold, it triggers a ‘RestockNeeded’ event. This event is sent to an external message bus connected to the supermarket’s logistics department, alerting them to replenish the stock.

  5. Fastlane Finale Service: It acts as a financial liaison in our system. It listens to events on the customer-departed topic, calculates the total price of the customer’s shopping using its knowledge of product prices, and subsequently publishes a message on the payment-due topic containing the customer’s ID and total price.

event-driven-architecture-with-mqtt's People

Contributors

copev313 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.