Skip to content

MessageExpirationConfiguration

blehnen edited this page Nov 10, 2026 · 5 revisions

Message Expiration Configuration

The message expiration configuration controls how often expired messages are removed from the queue.

Even if message expiration is enabled, you can tell the queue not to look for and remove expired messages. If you use message expiration, 'something' needs to do this. Otherwise, you may end up with messages that are never removed, and queue performance may suffer.

queue.Configuration.MessageExpiration.Enabled = true;

How often to look for expired messages and remove them.

queue.Configuration.MessageExpiration.MonitorTime = TimeSpan.FromSeconds(600);

Clone this wiki locally