Skip to content

aries-zhang/mns-netcore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mns-netcore

Build status NuGet

How to use

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages