1
0
mirror of synced 2024-11-05 11:09:17 +00:00
Tapeti/Examples/06-StatelessRequestResponse/ReceivingMessageController.cs

31 lines
870 B
C#

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
#pragma warning disable CA1822 // Mark members as static - not supported yet by Tapeti
public QuoteResponseMessage HandleQuoteRequest(QuoteRequestMessage message)
{
var quote = message.Amount switch
{
1 =>
// Well, they asked for it... :-)
"'",
2 => "\"",
_ => null
};
return new QuoteResponseMessage
{
Quote = quote
};
}
#pragma warning restore CA1822
}
}