2020-07-03 13:51:41 +00:00
|
|
|
|
using Messaging.TapetiExample;
|
2023-04-14 13:47:27 +00:00
|
|
|
|
using Tapeti.Config.Annotations;
|
2020-07-03 13:51:41 +00:00
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|