# Non-Durable Messaging Relaxed message delivery guarantees to improve performance at the cost of reliability. ## Overview Non-durable messaging trades delivery guarantees for better performance, increasing the risk of message loss during server crashes or restarts. > [!WARNING] > This approach significantly increases the risk of message loss when servers crash or restart. See [Effect on Transports](#effect-on-transports) for details. ## Enabling non-durable messaging This feature can be enabled in two ways ### For specific message types #### Via an Express attribute A message can be configured to be non-durable via the use of an `[ExpressAttribute]`. ```cs [Express] public class MessageWithExpress : IMessage { } ``` #### Using the configuration API A subset of messages can be configured to be non-durable by using a convention. ```cs var conventions = endpointConfiguration.Conventions(); conventions.DefiningExpressMessagesAs( type => { return type.Name.EndsWith("Express"); }); ``` ### Global for the endpoint Allows messages to be non-durable via the configuration API. ```cs endpointConfiguration.DisableDurableMessages(); ``` ## Effect on Transports Each transport implements non-durable messaging differently based on its underlying technology. ### MSMQ MSMQ typically uses _Store and Forward_ by default, storing messages durably on disk before delivery. With non-durable messaging, MSMQ sends messages in [Express Mode](https://msdn.microsoft.com/en-us/library/ms704130) by setting [`Message.Recoverable`](https://msdn.microsoft.com/en-us/library/system.messaging.message.recoverable) to `false`. Non-durable messages require [non-transactional queues](https://msdn.microsoft.com/en-us/library/ms704006). Configure this by setting `useTransactionalQueues` to `false` in the [transport connection string](/transports/msmq/connection-strings.md). > [!NOTE] > When using non-transactional queues, endpoints must be [configured not to use transactions](/transports/transactions.md#transaction-modes-unreliable-transactions-disabled). ### RabbitMQ Non-durable messages are sent using RabbitMQ's non-persistent delivery mode, which means the messages are not persisted to disk by the broker. See [controlling delivery mode](/transports/rabbitmq/index.md#controlling-delivery-mode) in the RabbitMQ transport documentation. ### SQL Server The SQL Server transport has no support for this setting and it is ignored. ### Azure Service Bus The Azure Service Bus transport has no support for this setting and it is ignored. ### Azure Storage Queues The Azure Storage Queues transport has no support for this setting and it is ignored. ### Amazon SQS The Amazon SQS transport has no support for this setting and it is ignored. ### IBM MQ The IBM MQ transports supports non-durable messaging with all supported transaction modes.