You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Larger messages (Move the limit from 4MB to the size of a string 1-2GB)
Transactional messages with Ack and NAck feature
Queue Handler (Listener) to trigger handler method when messages are received
Automatic management of queues (Create and Delete)
Cancelable Receiver
Async Receiver
This API includes the features that are most used (and needed for my other solution). The API makes the useof MSMQ easy and strait forward. I know this library is opinionated and only provide a sub set of the featuresin MSMQ API for Microsoft Message Queue (MSMQ).
Send and Receive
The following code sample will:
Create a new Private Queue on the current maschine, if not exists
Open a connections to the queue
Send a Message
Receive the same message
Close the connection
varqueueFactory=newQueueFactory();using(varqueue=queueFactory.CreateLocale("MyQueue",true,LocaleQueueMode.DurableCreate,true)){// Message will be serialized to json and chumped into pieces, all pieces send in the same transactionqueue.Send("MyMessage");// The receive has a timeout of 1 sec, and the message will be deserialized to the type (here string). This receive will automatically Ack the messagevarresponse=queue.Receive<string>(1000,newCancellationToken());}
Receive and Ack
The following code sample will:
Receive a transactional message
Try to Handle the message in some other method
If any exception, NAck the message for next receive to handle the samme message
varqueueFactory=newQueueFactory();varqueueHandlerFactory=newQueueHandlerFactory(queueFactory);using(varqueueHandler=queueHandlerFactory.Create()){queueHandler.Start("MyQueue",true,LocaleQueueMode.Durable,true,MessageHandler,null,null,0,true,false,newCancellationToken());// Wait for ever, or until cancelled}publicvoidMessageHandler(objectmessage,CancellationTokencancellationToken){// Do stuff with message}
Just ask for more samples!!!
About
Extended and opinionated API for Microsoft Message Queue (MSMQ)