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

376 views Asked by At

If I use WCF to send a message over e.g. 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?

1

There are 1 answers

0
Consult Yarla On

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.