Files
CBDDC/src/ZB.MOM.WW.CBDDC.Hosting/README.md
Joseph Doherty 7ebc2cb567
All checks were successful
NuGet Package Publish / nuget (push) Successful in 1m10s
Reformat/cleanup
2026-02-21 07:53:53 -05:00

2.1 KiB
Executable File

ZB.MOM.WW.CBDDC.Hosting

ASP.NET Core integration for CBDDC with health checks and hosted services.

Features

  • Cluster mode
  • Built-in health endpoint integration
  • Hosted services for sync server lifecycle
  • Respond-only server operation

Installation

dotnet add package ZB.MOM.WW.CBDDC.Hosting

Quick Start - Cluster

var builder = WebApplication.CreateBuilder(args);

// Add CBDDC core + BLite persistence (custom DbContext + DocumentStore required)
builder.Services.AddCBDDCCore()
    .AddCBDDCBLite<MyDbContext, MyDocumentStore>(
        sp => new MyDbContext("/var/lib/cbddc/data.blite"));

// Add ASP.NET integration (cluster mode)
builder.Services.AddCBDDCHosting(options =>
{
    options.Cluster.NodeId = "server-01";
    options.Cluster.TcpPort = 5001;
});

var app = builder.Build();

app.MapHealthChecks("/health");
app.Run();

Health Checks

CBDDC registers health checks that verify:

  • Database connectivity
  • Latest timestamp retrieval
curl http://localhost:5000/health

Deployment Mode

Cluster

Best for:

  • Dedicated database servers
  • Simple deployments
  • Development/testing environments

Server Behavior

CBDDC servers operate in respond-only mode:

  • Accept incoming sync connections
  • Respond to sync requests
  • Do not initiate outbound sync
  • Do not perform UDP discovery

Configuration Options

ClusterOptions

Property Type Default Description
NodeId string MachineName Unique node identifier
TcpPort int 5001 TCP port for sync
EnableUdpDiscovery bool false Enable UDP discovery

Production Checklist

  • Store BLite database files on durable storage in production
  • Configure health checks for load balancer
  • Set up proper logging and monitoring
  • Configure backup/restore for BLite database files
  • Configure proper firewall rules for TCP port
  • Set unique NodeId per instance
  • Test failover scenarios

License

MIT