dohertj2 dohertj2
  • Joined on 2026-02-20

ZB.MOM.WW.CBDDC.Hosting (1.0.3)

Published 2026-02-20 13:51:35 -05:00 by dohertj2

Installation

dotnet nuget add source --name dohertj2 --username your_username --password your_token 
dotnet add package --source dohertj2 --version 1.0.3 ZB.MOM.WW.CBDDC.Hosting

About this package

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

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

Dependencies

ID Version Target Framework
ZB.MOM.WW.CBDDC.Network 1.0.3 net10.0
Microsoft.Extensions.Diagnostics.HealthChecks 8.0.0 net10.0
Microsoft.Extensions.Hosting.Abstractions 8.0.0 net10.0
Microsoft.Extensions.Logging.Abstractions 8.0.0 net10.0
Serilog 4.2.0 net10.0
Details
NuGet
2026-02-20 13:51:35 -05:00
1
MrDevRobot
14 KiB
Assets (2)
Versions (1) View all
1.0.3 2026-02-20