Skip to content

About

Azure-native event-driven cache invalidation system built with .NET, Azure Container Apps, Azure Service Bus, Dragonfly, and Azure SQL Database, with containerized deployment and CI/CD support.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

33 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 MessageHubAzure

Build codecov Docker Compose CI License Release Zero Windows Dependencies GHCR api GHCR userapi GHCR web GHCR invalidator

🐳 Docker Hub Images

Service Pulls Size Version
API Pulls Size Version
User API Pulls Size Version
Web (Portal) Pulls Size Version
Function-Invalidator Pulls Size Version

MessageBus is a lightweight, Azure-integrated message pipeline focused on event-driven cache invalidation in .NET applications.

It provides a clean pattern for publishing events from APIs after completing database updates to an Azure Service Bus queue, and processing those events asynchronously using independent Azure Function worker.

The worker invokes the Web API's cache invalidation endpoint, which removes stale keys from the distributed cache (Dragonfly/Redis).

This approach keeps APIs fast and responsive while ensuring cache consistency across services.

The worker’s responsibility is only to remove stale keys. Any pre-warm logic (such as regenerating and repopulating cache values) remains inside the web application and will execute naturally on the next access after invalidation.

A single role update can affect hundreds of users — so distributed cache invalidation is essential for consistent authorization.


🔧 Features

✔️ Azure Service Bus Messaging

An event-publishing pattern using Azure Service Bus Queue supporting:

  • Asynchronous message delivery

  • Queue-based message processing

  • JSON serialization

  • Decoupled event publishing and consumption

✔️ Cache Invalidation Worker

An Azure Function worker triggered by Azure Service Bus messages that:

  • Receives cache invalidation events from Azure Service Bus

  • Invokes the Web API's cache invalidation endpoint

  • Removes stale keys from Dragonfly/Redis through the Web API

  • Optionally logs the invalidation action

The worker runs independently and never blocks the API.

✔️ Clean Publish → Process Pattern

A standard flow:

  1. API completes database update

  2. API publishes a cache-related event

  3. Azure Service Bus delivers the message to a queue.

  4. Azure Function consumes the message.

  5. Function invokes the Web API's cache invalidation endpoint.

  6. Web API removes the relevant keys from Dragonfly/Redis.


🧱 Architecture Snapshot

Integration Portal Architecture
View Mermaid source


🧩 Azure Function — Processing PermissionInvalidation Messages

Cache Invalidation Diagram
View Mermaid source


🚀 Automated Azure Deployment

MessageHubAzure uses GitHub Actions to automate deployments to Azure Container Apps.

The deployment workflow supports selective project builds and deployments by comparing changes against the previous Git tag.

  • Change Detection: Identifies modified projects by comparing the current release with the previous Git tag.

  • Selective Builds: Builds only the affected applications (Web App and User API).

  • Automated Deployment with Manual Triggering: Deploys the selected applications to Azure Container Apps when manually initiated through GitHub Actions.

This avoids unnecessary builds and deployments when a new version contains changes limited to specific applications.


📸 Screenshots

🔐 Permission Change Trigger (UI Action That Publishes the Event)

Permissions


🔍 Quick Start (Preview)

# Clone the repository
git clone https://github.com/hasanjaved-developer/message-hub-azure.git
cd message-hub-azure

# Start the observability stack
docker compose -f docker-compose.yml up -d

📜 License

This project is licensed under the MIT License.


About

Azure-native event-driven cache invalidation system built with .NET, Azure Container Apps, Azure Service Bus, Dragonfly, and Azure SQL Database, with containerized deployment and CI/CD support.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages