Can MSMQueue keep its value when restarting Windows?

I have an existing system and I wonder if MSMQueue can save the value of the queue if it restarts. It clears the value on restart.

+4
source share
3 answers

According to paxdiablo, MSMQ is a permanent solution for queues, but not by default! By default, it is used to store messages in RAM and so that MSMQ saves messages on disk so that they are not lost in the event of a server failure, you must specify it in the EACH message.

You can find more information about this by looking at the Message.Recoverable property.

+7
source

As Kjell-Åke Gafvelin already said, you can configure each message , but a more convenient way would be to set it in the queue itself : Reliable message transfer with MSMQ and .NET

MessageQueue msgQ = new MessageQueue(@".\private$\Orders"); msgQ.DefaultPropertiesToSend.Recoverable = true; msgQ.Send("This message will be marked as Recoverable"); msgQ.Close(); 

From the article above (highlights):

In the default section , MSMQ stores some messages in memory to increase performance, and a message can be sent and received from the queue without writing to disk .

In addition, you must make the queue transactional to ensure that the message is sent and received correctly.

+8
source

Yes, MSMQ is an ongoing queuing solution. It reliably stores messages in a backup storage that will not be affected by power loss (unless you experience things like a disk that is bloated separately from a really massive power surge, of course).

The point is to provide a reliable message queue in a potentially untrusted environment. To this end, losing messages when a particular server is down will be a significant drawback.

From Microsoft's own pages (and an apology for a language similar to a sales language):

Message Queuing applications can use the Message Queuing infrastructure to communicate on heterogeneous networks and with computers that can be offline. Message Queuing provides guaranteed message delivery , efficient routing, security, transaction support and priority messaging.

0
source

Source: https://habr.com/ru/post/1398172/


All Articles