Applies to: Exchange Server 2007 SP3, Exchange Server 2007 SP2, Exchange Server 2007 SP1, Exchange Server 2007
Topic Last Modified: 2008-03-11

A queue is a temporary holding location for messages that are waiting to enter the next stage of processing. Each queue represents a logical set of messages that a transport server processes in a specific order. Queues exist only on servers that have the Hub Transport server role or Edge Transport server role installed.

Microsoft Exchange Server 2007 uses an Extensible Storage Engine (ESE) database for queue message storage. Formerly known as JET, ESE is a method that defines a low-level API to the underlying database structures in Exchange Server.

An Overview of Queues

Table 1 lists the queues that exist on a Hub Transport server or Edge Transport server and their characteristics.

Table 1   Queues that exist on a Hub Transport server or Edge Transport server

Queue name Server role Number of queues on the server

Mailbox delivery queue

Hub Transport

One queue for every unique destination Mailbox server.

Poison message queue

Edge Transport

Hub Transport

1

Remote delivery queue

Edge Transport

Hub Transport

Edge Transport: One queue for every unique destination Simple Mail Transfer Protocol (SMTP) domain or smart host.

Hub Transport: One queue for every unique remote Active Directory directory service site.

Submission queue

Edge Transport

Hub Transport

1

Unreachable queue

Edge Transport

Hub Transport

1

An Overview of Queue Database Files

All the different queues are stored in a single ESE database. By default, this queue database is located at C:\Program Files\Microsoft\Exchange Server\TransportRoles\data\Queue.

Like any ESE database, the queue database uses log files to accept, track, and maintain data. To enhance performance, all message transactions are written first to log files and memory, and then to the database file. The checkpoint file tracks the transaction log entries that have been committed to the database. During an ordinary shutdown of the Microsoft Exchange Transport service, uncommitted database changes that are found in the transaction logs are always committed to the database.

Circular logging is used for the queue database. This means that the history of committed transactions that are found in the transaction logs is not maintained. Any transaction logs that are older than the current checkpoint are immediately and automatically deleted. Therefore, the transaction logs cannot be replayed for queue database recovery from backup.

Table 2 lists the files that constitute the queue database.

Table 2   Files that constitute the queue database

File Description

Mail.que

This queue database file stores all the queued messages.

Tmp.edb

This temporary database file is used to verify the queue database schema on startup.

Trn*.log

This transaction log records all changes to the queue database. Changes to the database are first written to the transaction log and are then committed to the database. Trn.log is the current active transaction log file. Trntmp.log is the next provisioned transaction log file that is created in advance. If the existing Trn.log transaction log file reaches its maximum size, Trn.log is renamed to Trnnnnn.log, where nnnn is a sequence number. Trntmp.log is then renamed Trn.log and becomes the current active transaction log file.

Trn.chk

This checkpoint file tracks the transaction log entries that have been committed to the database. This file is always in the same location as the mail.que file.

Trnres00001.jrs

Trnres00002.jrs

These reserve transaction log files act as placeholders. They are only used when the hard disk drive that contains the transaction log runs out of space to stop the queue database cleanly.

Options for Configuring the Queue Database

You can't use the Exchange Management Console or the Exchange Management Shell to configure the queue database. You configure the queue database by modifying the EdgeTransport.exe.config file that is located in C:\Program Files\Microsoft\Exchange Server\Bin. The EdgeTransport.exe.config file is an XML application configuration file that is associated with the EdgeTransport.exe file. EdgeTransport.exe and MSExchangeTransport.exe are the executable files that are used by the Microsoft Exchange Transport service. This service runs on every Hub Transport server or Edge Transport server. Changes that are made to the EdgeTransport.exe.config file are applied after the Microsoft Exchange Transport service is restarted.

The following is a basic example of the EdgeTransport.exe.config file structure:

<configuration>

<runtime>

<gcServer enabled="true" />

</runtime>

<appSettings>

<add key=" ConfigurationOption " value=" Value " />

...

</appSettings>

</configuration>

The <appSettings> section is where you can add new configuration options or modify existing configuration options. Many configuration options that are completely unrelated to the queue database are also available. However they are outside the scope of this topic and won't be discussed here.

Note:
The parameter names in the <add key=../> section are case sensitive.

The configuration options for the queue database that are available in the EdgeTransport.exe.config file are described in Table 3.

Table 3   Message queue database configuration options that are available in the EdgeTransport.exe.config file

Parameter name Description

QueueDatabaseBatchSize

This parameter specifies the number of database I/O operations that can be grouped together before they are executed. The default value is 40. For each message received, the I/O cost of the message is derived based on the number of recipients on the message and the size of the message. If the I/O cost of a message exceeds the value specified in the QueueDatabaseBatchSize parameter, that message is committed to the queue database immediately. Otherwise, it will be combined with other messages received, and they will be committed to the queue database together.

Caution:
Do not modify this parameter unless directed by a Microsoft Customer Support Services representative.

QueueDatabaseBatchTimeout

This parameter specifies the maximum time in milliseconds that the database will wait for multiple database I/O operations to group before it executes them. The database I/O operations are executed without waiting for any more if the following conditions are true:

  • The number of database I/O operations that is specified by the QueueDatabaseBatchSize parameter has not been reached.

  • The time specified QueueDatabaseBatchTimeout parameter has passed.

The default value is 100.

QueueDatabaseMaxConnections

This parameter specifies the number of ESE database connections that can be open. The default value is 4.

QueueDatabaseLoggingBufferSize

This parameter specifies the memory that is used to cache the transaction records before they are written to the transaction log file. The default value is 524288 bytes.

QueueDatabaseLoggingFileSize

This parameter specifies the maximum size of a transaction log file. When the maximum log file size is reached, and new log file is opened. The default value is 5242880 bytes.

QueueDatabaseLoggingPath

This parameter specifies the default directory for the queue database log files. The default value is C:\Program Files\Microsoft\Exchange Server\TransportRoles\data\Queue. Before you change the queue database logging directory, make sure that the new directory exists. Also make sure that the following file permissions are applied to it: Network Service: Full Control; System: Full Control; Administrators: Full Control.

QueueDatabaseMaxBackgroundCleanupTasks

This parameter specifies the maximum number of background cleanup work items that can be queued to the database engine thread pool at any time. The default value is 32.

QueueDatabaseOnlineDefragEnabled

The parameter enables or disables scheduled online defragmentation of the mail queue database. The default value is $true.

QueueDatabaseOnlineDefragSchedule

This parameter specifies the time of day in 24 hour format to start the online defragmentation of the mail queue database. To specify a value, enter the value as a time span: hh:mm:ss, where h = hours, m = minutes, and s = seconds. The default value is 1:00:00 or 1:00 AM.

QueueDatabaseOnlineDefragTimeToRun

This parameter specifies the time that the online defragmentation task is allowed to run. Even if the defragmentation task does not finish in the time specified, the queue database is left in a consistent state. To specify a value, enter the value as a time span: hh:mm:ss, where h = hours, m = minutes, and s = seconds. The default value is 3:00:00.

QueueDatabasePath

This parameter specifies the default directory for the queue database files. The default value is C:\Program Files\Microsoft\Exchange Server\TransportRoles\data\Queue. Before you change the queue database directory, make sure that the new directory exists. Also make sure that the following file permissions are applied to it: Network Service: Full Control; System: Full Control; Administrators: Full Control.

For More Information

For more information about queues, see Managing Queues.

For more information about how to change the queue database location, see How to Change the Location of the Queue Database.