Welcome to the Messaging Patterns Labs repository! This project contains hands-on labs demonstrating different messaging patterns using Azure Service Bus and .NET. These labs are designed to help you understand and implement common messaging patterns in distributed systems. The labs included are:
- Request/Reply Messaging Pattern
- Scatter-Gather Messaging Pattern
- Saga Messaging Pattern
Each lab walks you through the process of building and running a sample application that implements the pattern, providing detailed instructions, sample code, and explanations of the key concepts.
Overview:
This lab demonstrates a synchronous communication model where one component (the requester) sends a message and waits for an immediate reply from the responder. The Request/Reply pattern is helpful for scenarios requiring immediate response, such as querying data or confirming an action.
Learn more & Run the Lab:
Overview:
The Scatter-Gather pattern distributes a request to multiple services (scattered recipients), which process it concurrently. The requester subsequently collects and aggregates the responses. This asynchronous pattern is ideal for tasks that can be processed in parallel and combined, such as distributed searches or data processing.
Learn more & Run the Lab:
Overview:
The Saga pattern orchestrates a long-running, multi-step business process across multiple services. Instead of a distributed transaction, a saga breaks the process into a series of local transactions, each committed independently. The Saga Coordinator handles the sequential execution of these transactions and triggers compensating actions if any step fails. This pattern is essential in microservices architectures, where maintaining consistency without distributed transactions is required.
Learn more & Run the Lab:
Before running the labs, ensure you have the following installed:
- .NET 8.0 SDK (or a later compatible version)
- Azure Service Bus Emulator configured with the provided
config.json(or an Azure Service Bus namespace) - Basic familiarity with C# and asynchronous programming patterns
-
Clone the Repository:
git clone https://github.com/TaleLearnCode/MessagingPatternsToTransformYourCloudArchitecture.git cd MessagingPatternsToTransformYourCloudArchitecture -
Review Each Lab's README: Each lab contains its own README file with details setup instructions, including how to configure the Service Bus emulator, build the project, and run the sample.
- Request/Request: request-reply/README.md
- Scatter-Gather: scatter-gather/README.md
- Saga: saga/README.md
-
Configure Your Environment: Ensure the Azure Service Bus Emulator runs and is configured using the provided
config.jsonfiles in each lab's documentation.