.net 4.5 中是否没有 MSMQ 发送的异步实现

Is there no Async implementation of MSMQ send in .net 4.5

不知为何MSMQ发送没有异步实现?我正在使用.net 4.5。我错过了什么吗?

不需要 Send 的异步版本,因为 Send 是异步的。

来自 MSDN

Sending messages in Message Queuing is always an asynchronous operation. When you are sure the queue is open, you can continue to send messages without stopping to wait for a reply.

甚至for remote queues

When a message is sent to an opened queue on a remote computer, Message > Queuing stores the message in an outgoing queue on the local computer.

您是否遇到了特定的性能问题,或者您想使用异步方法以防 Send 导致阻塞?

不正确,Send 正在阻塞,尽管它只是写入本地队列。

在调用 MessageQueue.Send(..) 之前调用 await Task.Yield();

如果你纯粹使用async/await,这将对吞吐量产生相当大的影响。