Share via


How to: Store Messages in Journal Queues

There are two ways you can set up the use of journal queues for sent messages — you can set a default property for your MessageQueue component so that all messages sent by it will use journals, or you can establish journal queue recording for individual messages you are sending.

For an overview of journal storage, see Message Queue Journal Storage.

To use journals for all messages sent by an instance of the MessageQueue component

  1. Create an instance of the MessageQueue component and set its Path property to the queue to which you want to refer. For more information, see How to: Create MessageQueue Component Instances.

  2. In the Properties window, set the UseJournalQueue property on the DefaultPropertiesToSend class for your component to true.

To set journal recording for an individual message

  1. Create the message you want to send.

  2. In code, set the UseJournalQueue property to true. Your code might look like this:

    Message1.UseJournalQueue = True
    
           Message1.UseJournalQueue = true;
    

To set journal recording for messages removed from a queue

  1. Create an instance of the MessageQueue component and set its Path property to the queue to which you want to refer. For more information, see How to: Create MessageQueue Component Instances.

  2. Set the UseJournalQueue property for the MessageQueue component that references that queue to true. Your code might look like this:

    MessageQueue1.UseJournalQueue = True
    
            MessageQueue1.UseJournalQueue = true;
    

To set the maximum size for a journal queue

  1. Create an instance of the MessageQueue component and set its Path property to the journal queue you want to refer to. For more information, see How to: Create MessageQueue Component Instances.

  2. Set the MaximumJournalSize property to the capacity, in kilobytes, that you want to use for your journal queue.

See Also

Tasks

How to: Purge Queue Contents

How to: Request Acknowledgement for Messages

How to: Create MessageQueue Component Instances

Concepts

Message Queue Journal Storage

Default Message Properties

Other Resources

Sending and Serializing Messages