Utilities that light up Azure Service Bus inside a .NET Aspire AppHost. The package exposes strongly-typed resources, configuration conventions, and builder extensions to ensure your messaging topology is defined once and consumed consistently by DKNet services.
ServiceBusResource models namespaces and queues/topics with metadata that maps directly to Aspire resources.AddServiceBus helpers register namespaces, queues, and secrets in a single fluent call.var builder = DistributedApplication.CreateBuilder(args);
var serviceBus = builder.AddServiceBus("messaging", configure =>
{
configure.WithNamespace("dknet-dev")
.WithQueue("commands")
.WithTopic("events");
});
var api = builder.AddProject<Projects.Api>("api");
api.WithReference(serviceBus);
builder.Build().Run();
The extension registers Azure Service Bus namespaces and ensures downstream projects automatically receive connection strings named according to the DKNet conventions.
ServiceBusResource exposes fluent methods to tailor the messaging topology:
WithNamespace(name) – Sets the Azure Service Bus namespace (supports parameterisation via environment variables).WithQueue(name, configure?) – Adds queues with optional dead-letter, TTL, and partition settings.WithTopic(name, configure?) – Declares topics with subscription metadata.WithSecretsFrom(connectionName) – Rebinds connection strings when using existing Azure resources.All resources surface Aspire’s ResourceBuilder API so you can chain additional metadata (tags, env vars, replicas).
DKNet.SlimBus.Extensions messaging package in worker/API projects.[FromConnectionString]) to bind queue/topic connection strings into message handlers.DKNet.AspCore.Tasks background jobs to seed queues or purge poison messages during startup.builder.AddParameter for secure secret management.