BusProxy - Project Overview

🏠 Home BusProxy / docs

BusProxy - Project Overview

Solution Structure

Solution: TELS.WebServices.BusProxy.sln

Project Type Framework Description
TELS.WebServices.BusProxy ASP.NET Core Web API .NET 8.0 REST API for message publishing
TELS.BusProxy.Client Class Library .NET Standard 2.0 Client NuGet package for consuming services
TELS.BusProxy.Client.SqlFallback Class Library .NET Standard 2.0 SQL Server fallback handler
TELS.BusProxy.Client.S3Fallback Class Library .NET Standard 2.0 AWS S3 fallback handler
TELS.WebServices.BusProxy.DbUp Console App .NET 8.0 Database migrations
TELS.WebServices.BusProxy.Test Unit Tests .NET 8.0 API tests

Purpose

BusProxy is a centralized message publishing infrastructure that decouples services from specific message bus technologies. It provides:

  1. Technology-Agnostic Publishing: Services call HTTP API, BusProxy handles bus-specific details
  2. Resilient Delivery: Automatic fallback to SQL Server or AWS S3 if primary bus unavailable
  3. Delayed Delivery: Schedule messages for future delivery
  4. Multi-cast: Publish to multiple bus technologies simultaneously
  5. Background Processing: Retry failed messages every 60 seconds

Architecture

Components

Consumer Service
  ↓ (HTTP POST)
BusProxy API
  ↓ (primary)
RabbitMQ / SQS / MSMQ
  ↓ (fallback on failure)
SQL Server Queue ←→ bus-proxy-queue-processor
  OR
AWS S3 Bucket

Fallback Strategies

Environment Primary Fallback
Production/Sandbox RabbitMQ AWS S3
Local/Integration RabbitMQ SQL Server

Technology Stack

Category Technology
Runtime .NET 8.0 (API), .NET Standard 2.0 (Client)
Web Framework ASP.NET Core 8.0
Message Bus MassTransit 8.5.7 + RabbitMQ
Database SQL Server (TELS database)
Cloud Storage AWS S3 (AWSSDK.S3 4.0.15.1)
Migration DbUp
Logging NLog 6.0.7
Monitoring New Relic APM 10.47.2
Auth JWT Bearer
API Docs Swagger/Swashbuckle 9.0.3
Containerization Docker (multi-arch: ARM64 preferred, AMD64 fallback)

Key Features

1. Resilient Message Publishing

2. Client Libraries (NuGet Packages)

3. Delayed Delivery

4. Authorization


API Surface

Endpoints

Authentication


Database

SQL Server (TELS Database)

Tables: - Message queue table (fallback storage) - Authorized users table - Processing state tracking


Deployment

Docker Containers

Configuration

Setting Purpose
RabbitMQ Connection Primary message bus
SQL Connection Fallback storage + auth
AWS S3 Fallback storage (prod)
JWT Signing Key Token validation
Retry Interval Background processor frequency (60s)

Client Usage Example

// Add NuGet packages:
// TELS.BusProxy.Client
// TELS.BusProxy.Client.SqlFallback (or S3Fallback)

// Register in DI
services.AddSingleton<IDeliveryHandler, WebServiceHandler>();
services.AddSingleton<IDeliveryHandler, SqlServerFallbackHandler>(); // or S3FallbackHandler
services.AddSingleton<IPublisher, Publisher>();

// Publish message
await publisher.PublishMessage(new MyEvent
{
    Data = "value"
});

bus-proxy-queue-processor: Worker service that processes messages from SQL fallback queue


Key Files

File Purpose
/src/TELS.WebServices.BusProxy/Controllers/PublishController.cs API endpoints
/src/TELS.BusProxy.Client/Publisher.cs Client library
/src/TELS.BusProxy.Client.SqlFallback/SqlServerFallbackHandler.cs SQL fallback
/src/TELS.BusProxy.Client.S3Fallback/S3FallbackHandler.cs S3 fallback
/README.md Setup and usage documentation

Notes