-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Program.cs
33 lines (27 loc) · 1.35 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using Azure.Identity;
using HealthCheck;
using Tingle.EventBus.Configuration;
var host = Host.CreateDefaultBuilder(args)
.ConfigureServices((hostContext, services) =>
{
var configuration = hostContext.Configuration;
services.AddEventBus(builder =>
{
builder.AddConsumer<VehicleTelemetryEventsConsumer>();
var credential = new DefaultAzureCredential();
// Transport specific configuration
builder.AddAzureServiceBusTransport(options =>
{
options.Credentials = new AzureServiceBusTransportCredentials
{
TokenCredential = credential,
FullyQualifiedNamespace = "{your_namespace}.servicebus.windows.net"
};
options.DefaultEntityKind = EntityKind.Queue; // required if using the basic SKU (does not support topics)
});
builder.Services.AddHealthChecks()
.AddCheck<AzureServiceBusHealthCheck>(name: "servicebus", tags: ["eventbus"]);
});
})
.Build();
await host.RunAsync();