1
0
mirror of synced 2024-11-22 01:13:49 +00:00
Tapeti/Examples/06-StatelessRequestResponse/ReceivingMessageController.cs
Mark van Renswoude 165680fd38 Added ValueTask support
- This is a breaking change for custom middleware implementations
Added validation for return type handling
- This may be breaking for incorrect implementations, but highly unlikely
2022-02-09 11:27:07 +01:00

29 lines
743 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
public static QuoteResponseMessage HandleQuoteRequest(QuoteRequestMessage message)
{
var quote = message.Amount switch
{
1 =>
// Well, they asked for it... :-)
"'",
2 => "\"",
_ => null
};
return new QuoteResponseMessage
{
Quote = quote
};
}
}
}