2020-07-03 13:51:41 +00:00
|
|
|
|
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
|
2022-02-09 10:26:56 +00:00
|
|
|
|
public static QuoteResponseMessage HandleQuoteRequest(QuoteRequestMessage message)
|
2020-07-03 13:51:41 +00:00
|
|
|
|
{
|
2022-02-09 08:19:56 +00:00
|
|
|
|
var quote = message.Amount switch
|
2020-07-03 13:51:41 +00:00
|
|
|
|
{
|
2022-02-09 08:19:56 +00:00
|
|
|
|
1 =>
|
2020-07-03 13:51:41 +00:00
|
|
|
|
// Well, they asked for it... :-)
|
2022-02-09 08:19:56 +00:00
|
|
|
|
"'",
|
|
|
|
|
2 => "\"",
|
|
|
|
|
_ => null
|
|
|
|
|
};
|
2020-07-03 13:51:41 +00:00
|
|
|
|
|
|
|
|
|
return new QuoteResponseMessage
|
|
|
|
|
{
|
|
|
|
|
Quote = quote
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|