-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathProgram.cs
More file actions
24 lines (23 loc) · 835 Bytes
/
Copy pathProgram.cs
File metadata and controls
24 lines (23 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using MetricsExample;
using MetricsExample.Model;
using Microsoft.Extensions.Hosting;
using Motor.Extensions.Conversion.SystemJson;
using Motor.Extensions.Hosting.Consumer;
using Motor.Extensions.Hosting.RabbitMQ;
using Motor.Extensions.Utilities;
await MotorHost
.CreateDefaultBuilder()
// Configure the types of the input and output messages
.ConfigureNoOutputService<InputMessage>()
// Add the incomming communication module.
.ConfigureConsumer<InputMessage>(
(_, builder) =>
{
// In this case the messages are received from RabbitMQ
builder.AddRabbitMQ();
// The encoding of the incoming message, such that the handler is able to deserialize the message
builder.AddSystemJson();
}
)
.UseStartup<Startup>()
.RunConsoleAsync();