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