1
0
mirror of synced 2024-12-23 09:43:07 +01:00
Tapeti/Examples/06-StatelessRequestResponse/ReceivingMessageController.cs

29 lines
743 B
C#
Raw Normal View History

using Messaging.TapetiExample;
using Tapeti.Annotations;
namespace _06_StatelessRequestResponse
{
[MessageController]
[DynamicQueue("tapeti.example.06.receiver")]
public class ReceivingMessageController
{
// No publisher required, responses can simply be returned
public static QuoteResponseMessage HandleQuoteRequest(QuoteRequestMessage message)
{
2022-02-09 09:19:56 +01:00
var quote = message.Amount switch
{
2022-02-09 09:19:56 +01:00
1 =>
// Well, they asked for it... :-)
2022-02-09 09:19:56 +01:00
"'",
2 => "\"",
_ => null
};
return new QuoteResponseMessage
{
Quote = quote
};
}
}
}