Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can MSMQueue retain their value when the Windows restart?

Tags:

msmq

I have an existing system and am wondering if MSMQueue can retain value of queue if it restarts. It clears the value when I restart.

like image 257
Nap Avatar asked Feb 24 '12 05:02

Nap


People also ask

What is message queuing service Windows 10?

What is MSMQ? From Microsoft: Microsoft Message Queuing (MSMQ) technology enables applications running at different times to communicate across heterogeneous networks and systems that may be temporarily offline. MSMQ provides guaranteed message delivery, efficient routing, security, and priority-based messaging.

How do I add Message Queuing triggers?

Click Start and open Control Panel, Administrative Tools, and Computer Management. Open Services and Applications, Message Queuing, Message Queuing Triggers, and Rules. For each rule, open the Properties dialog, and select the Rule Action tab.

What is Message Queuing (MSMQ)?

Message Queuing (MSMQ) Message Queuing (MSMQ) technology enables applications running at different times to communicate across heterogeneous networks and systems that may be temporarily offline. Applications send messages to queues and read messages from queues.

What happens if I do not restart the message queuing service?

If you do not restart the Message Queuing service, the disk storage usage remains at the peak requirement since the last restart of the Message Queuing service. Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method.

What are the properties of msmqoutgoingqueuemanagement object?

The MSMQOutgoingQueueManagement object defines the following properties. Returns the address for routing messages to the destination queue in the next hop. Returns the connection state of the outgoing queue.

What is message queueing in Linux?

Message Queuing provides guaranteed message delivery, efficient routing, security, and priority-based messaging. It can be used to implement solutions to both asynchronous and synchronous scenarios requiring high performance. The following list shows several places where Message Queuing can be used.


Video Answer


2 Answers

As paxdiablo writes MSMQ is a persistent queueing solution, but not by default! The default is to store messages in RAM and to have MSMQ to persist messages to disk so they are not lost in case of a server crash you have to specify it on EACH message.

More information on this can be found if you take a look at the property Message.Recoverable.

like image 148
Kjell-Åke Gafvelin Avatar answered Oct 13 '22 23:10

Kjell-Åke Gafvelin


As @Kjell-Åke Gafvelin already said, you may configure each message, but the IMHO more convenient way would be to set it on the Queue itself.

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 by me):

By default, MSMQ stores some messages in memory for increased performance, and a message may be sent and received from a queue without ever having been written to disk.

Aditionally, you should make the queue transactional to guarantee the correct shipment and receiving of a message.

(Edit 2020-10-27: Removed link to external Microsoft post "Reliable messaging with MSMQ and .NET" as it is not available anymore.)

like image 33
Jens H Avatar answered Oct 13 '22 23:10

Jens H