1
0
mirror of synced 2024-12-23 01:33:07 +01:00
Tapeti/Examples/04-Transient/UsersMessageController.cs

25 lines
677 B
C#
Raw Normal View History

using System;
using System.Threading.Tasks;
using Messaging.TapetiExample;
using Tapeti.Config.Annotations;
namespace _04_Transient
{
[MessageController]
[DynamicQueue("tapeti.example.04")]
public class UsersMessageController
{
// No publisher required, responses can simply be returned
public async Task<LoggedInUsersResponseMessage> HandleQuoteRequest(LoggedInUsersRequestMessage message)
{
// Simulate the response taking some time
await Task.Delay(1000);
return new LoggedInUsersResponseMessage
{
Count = new Random().Next(0, 100)
};
}
}
}