forked from GDATASoftwareAG/motornet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
21 lines (20 loc) · 793 Bytes
/
Program.cs
File metadata and controls
21 lines (20 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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();