In this poject we're presenting an entire architecture with an API rest, a cluster of MOM's and some clients.
The idea is that the clients will
- create and delete topics
- create and delete queues
- create and delete messages inside each structure
UNIX Go inside rest_API and run the following command
rm -rf build/;mkdir build; cd build; cmake ..;make;./momWINDOWS Go inside rest_API and run the following command
Remove-Item -Recurse -Force build; New-Item -ItemType Directory -Path build; Set-Location -Path build; cmake ..; make; ./momAfter this your endpoints should be running
UNIX Go inside mom_communication and run the following command
rm -rf build/;mkdir build; cd build; cmake ..;makeWINDOWS Go inside rest_API and run the following command
Remove-Item -Recurse -Force build; New-Item -ItemType Directory -Path build; Set-Location -Path build; cmake ..; make; ./momyou should clone, compile and link the grpc library, for this project we used the v1.71.0
-
Build gRPC with Cmake - https://github.com/grpc/grpc/blob/v1.71.0/BUILDING.md
-
Download crow - https://crowcpp.org/master/getting_started/setup/linux/
-
gRPC DOCS - https://grpc.io/docs/languages/cpp/basics/
- Edwar Mauricio Carrillo Carvajal
- Valeria Corrales Hoyos
- Valentina Giraldo Noreña
This project involves the design and implementation of a Message-Oriented Middleware (MOM) that enables asynchronous communication between multiple client applications through queues and topics. The system is designed with a cluster approach, allowing for multiple MOM nodes that ensure high availability and fault tolerance. The middleware abstracts the complexity of communication between applications, allowing clients to focus on their business logic rather than worrying about the details of communication in distributed systems.
- Cluster Architecture: Distributed system with multiple nodes working together to ensure high availability.
- Leader-Follower Mechanism: A leader node coordinates operations and replicates data to follower nodes.
- Topic Management: Create, delete, and list topics for publish-subscribe messaging patterns.
- Queue Management: Create, delete, and list queues for point-to-point messaging.
- Authentication: User authentication for secure connections.
- Message Persistence: Option to persist messages for durability.
- Fault Tolerance: Mechanisms to handle node failures and ensure system reliability.
- REST API: Client-facing API for easy integration.
- gRPC Communication: Efficient node-to-node communication using gRPC.
- Topic Subscription: Clients can subscribe queues to topics to receive messages.
- C++: Core implementation language
- gRPC: For efficient node-to-node communication
- Protocol Buffers: For data serialization
- Crow: Lightweight C++ web framework for REST API
- CMake: Build system
- AWS: Deployment environment
The architecture consists of the following components:
- REST API Gateway: Provides HTTP endpoints for client applications
- MOM Nodes: Leader and Follower nodes forming the cluster
- Queues: Store messages for point-to-point communication
- Topics: Enable publish-subscribe pattern messaging
- Clients: Producer and Consumer applications
This diagram illustrates:
- Cluster initialization phase
- Normal operations phase
- Fault tolerance mechanisms
| Endpoint | Method | Description |
|---|---|---|
/queues |
GET | List all queues |
/queues/<name>?owner=<owner> |
POST | Create a new queue |
/queues/<name>?owner=<owner> |
DELETE | Delete a queue |
/queues/<name>/message?owner=<owner>&content=<content> |
POST | Send a message to a queue |
/queues/<name>/message?owner=<owner> |
GET | Receive a message from a queue |
| Endpoint | Method | Description |
|---|---|---|
/topics |
GET | List all topics |
/topics/<name>?owner=<owner> |
POST | Create a new topic |
/topics/<name>?owner=<owner> |
DELETE | Delete a topic |
/topics/<name>/message?owner=<owner>&content=<content> |
POST | Publish a message to a topic |
/topics/<name>/message?owner=<owner> |
GET | Receive a message from a topic |
| Endpoint | Method | Description |
|---|---|---|
/subscribe_queue?topic_name=<topic_name>&topic_owner=<topic_owner>&queue_name=<queue_name>&queue_owner=<queue_owner> |
POST | Subscribe a queue to a topic |
/subscribe_queue?topic_name=<topic_name>&topic_owner=<topic_owner>&queue_name=<queue_name>&queue_owner=<queue_owner> |
DELETE | Unsubscribe a queue from a topic |

