Skip to content

A minimal project showcasing using .NET with Azure Service Bus

License

Notifications You must be signed in to change notification settings

JustJordanT/dotnet-azure-service-bus

Repository files navigation

.NET Azure Service Bus

graph TD;
    A[.NET Service Alpha] -->|Send Message| B[Azure Service Bus Queue]
    B -->|Receive| G[.NET Service Beta]
    B -->|Receive| H[.NET Service Gamma]
Loading

Overviews

This project demonstrates a minimal setup to use Azure Service Bus with .NET, showcasing an implementation of event-driven architecture. It includes examples for sending messages to a Service Bus topic, creating subscriptions to that topic, and receiving messages from the subscriptions.

Event-driven architecture is a software design pattern in which the flow of the program is determined by events such as user actions, sensor outputs, or messages from other programs or services. In this context, Azure Service Bus acts as both the event publisher and consumer.

Key aspects of event-driven architecture demonstrated in this project:

  • Decoupling: Azure Service Bus allows for loose coupling between components, enabling greater flexibility and scalability.
  • Asynchronous communication: Messages are sent and received asynchronously, improving system responsiveness.
  • Event-driven flow: The system reacts to events (messages) as they occur, rather than following a predefined sequence of operations.
  • Scalability: By using managed services like Azure Service Bus, the architecture can easily scale to handle varying loads.

This setup provides a foundation for building more complex event-driven systems, allowing developers to create responsive, scalable applications that can efficiently process and react to events in real time.

Table of Contents

  1. Prerequisites
  2. Installation
  3. Configuration
  4. Usage
  5. Contributing
  6. License

Prerequisites

  • .NET Core 3.1 or higher
  • Azure CLI configured with appropriate permissions
  • Azure SDK for .NET (Azure.Messaging.ServiceBus)

Installation

  1. Clone the repository:

    git clone [email protected]:justjordant/dotnet-azure-service-bus.git
  2. Navigate to the project directory:

    cd dotnet-azure-service-bus
  3. Restore the project:

    dotnet restore

Configuration

  1. Rename the appsettings.json.example file to appsettings.json and fill in the required Azure Service Bus connection string and configurations.

    {
      "Azure": {
        "ServiceBus": {
          "ConnectionString": "your-service-bus-connection-string"
        }
      }
    }

Usage

Send to Service Bus Topic

Run the following command to send a message to the Service Bus topic:

dotnet run --project ./service.alpha

Receive from Service Bus Subscription

Run the following command to start receiving messages from a Service Bus subscription:

dotnet run --project ./service.beta
dotnet run --project ./service.gamma

Contributing

  1. Fork the repository.
  2. Create a new feature branch.
  3. Make your changes.
  4. Submit a pull request.

For more details, see CONTRIBUTING.md.

License

This project is licensed under the MIT License. See LICENSE.md for details.


Feel free to adapt this README to better suit your project's specific needs.

About

A minimal project showcasing using .NET with Azure Service Bus

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published