Send messages:
var Queue = MNS.Configure(Host, AccessKey, AccessSecret).Queue("test");
for (int i = 0; i < 200; i++)
{
var result = Queue.SendMessage($"Hellow world #{i}");
}
Receive messages:
var Queue = MNS.Configure(Host, AccessKey, AccessSecret).Queue("test");
while (true)
{
try
{
var message = Queue.ReceiveMessage();
Console.WriteLine("message processing..");
SomeBusiness.Process(message);
Console.WriteLine("message processed");
Queue.DeleteMessage(message.ReceiptHandle);
Console.WriteLine("message deleted.");
}
catch (Exception ex)
{
if (ex is MessageNotExistException)
continue;
throw ex;
}
}
For full operations, please see here.