Gets or sets a value indicating whether a copy of the message should be kept in a machine journal on the originating computer.
[Visual Basic] Overridable Public Property UseJournalQueue As Boolean [C#] public bool UseJournalQueue {virtual get; virtual set;} [C++] public: __property virtual bool get_UseJournalQueue(); public: __property virtual void set_UseJournalQueue(bool); [JScript] public function get UseJournalQueue() : Boolean; public function set UseJournalQueue(Boolean);
true to require that a copy of a message be kept after transmission from the originating computer to the next hop; otherwise, false. The default is false.
Exception Type | Condition |
---|---|
InvalidOperationException | The message queue is filtered not to read the UseJournalQueue property. |
UseJournalQueue provides access to part of the functionality of the Journal property of the Message Queuing MSMQMessage object. The Journal property is accessed by both UseDeadLetterQueue and UseJournalQueue in the Message object.
When you store messages in a journal queue, clear the queue periodically to remove messages that are no longer needed. Messages stored in journal queues count against the quota for the computer where the queue resides.
Note The computer quota is set by the administrator.
The following example creates an empty message. The example populates the Message with a string Body, sets the UseJournalQueue property according to the priority, and then sends the message to a queue. It assumes there is a queue on the computer "myComputer" with the name "myQueue".
Note Choosing to set the System.Messaging.Message.UserJournalQueue property according to the priority is arbitrary and used only for illustrative purposes. A relation between the two is not necessary.
Import the System.Messaging namespace for this example.
[Visual Basic]
Private Sub CreateMessage(ByVal priority As MessagePriority) 'Declare a message and message queue Dim msg As Message Dim mq As MessageQueue 'Instantiate an empty message object msg = New Message 'Instantiate a new MessageQueue object mq = New MessageQueue("myComputer\myQueue") If priority = MessagePriority.Highest Then 'Use the journal queue for the message msg.UseJournalQueue = True Else 'Don't use the journal queue for the message. msg.UseJournalQueue = False End If msg.Body = "New Message Body" 'Send the message to the queue. mq.Send(msg) End Sub
Message Class | Message Members | System.Messaging Namespace