简体   繁体   中英

What happens to messages sent over MSMQ and WCF that exceed the receivers quota?

If I use WCF to send a message over eg Http , and the message is too large for the recipient, I get a fault at the sender, and can take action.

If I use WCF to send a message over MSMQ (non-transactional) and the message is too large for the recipient, it seems to disappear and I get no indication either client or server side.

Is there some way I can observe (and take action for) such occurrences?

Assuming, your target is an MSMQ, (irrespective to WCF), here are few items to consider.

  1. The maximum size of a single message to publish to MSMQ is 4Mb.
  2. If a message over 4Mb is tried to be published to MSMQ, you WILL receive the following error: [System.ServiceModel.ExceptionDetail]: Internal Error : Insufficient resources to perform operation.
  3. If your requirement is to publish messages over 4Mb to MSMQ, then there are few solutions for this, like,
    • Using NServiceBus
    • Compressing message during publish and Decompressing the same in the retrieval.
    • Implementing the NServiceBus logic, which is, to write the message to a file at a shared location and store the file location in the message.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM