Does MSMQ ensure data integrity on transactional queues? RRS feed

  • Question

  • I'm using MSMQ to transfer a byte array.

    The formatter is a BinaryMessageFormatter.

    The destination queue is a private one, and I'm using direct TCP communication.

    The destination machine is in a different LAN, I access it by its external IP address.

    There's a firewall which routs the incoming TCP communication to the actual destination machine (port forwarding).

    So the system's architecture looks like this:

    [source machine] --> [destination firewall] --> [destination machine]

    I've been using the system for a few months, and all went fine.

    Recently we experienced a firewall failure.

    Apparently, this caused to data corruption:

    While the queue is transactional, and the message, according to MSMQ, was successfully delivered to the destination machine, the message's content was corrupted.

    That is, the code for reading the message from the queue raised an exception:

        var message = queue.Receive(readTimeout, transaction);
        if (message != null)
            data = (byte[]) message.Body; // <-- this line raises an exception
            return true;
    catch (Exception e)

    I had to delete a few messages from (the top of) the queue, and then the system got back to normal.

    My question:

    Assuming that it was only the firewall's failure that caused this, and knowing it's a transactional queue, how come the message was considered to be delivered?
    Isn't MSMQ executing some kind of a checksum to ensure data integrity on transactional queues?

    • Edited by Klein Ron Wednesday, May 2, 2012 9:41 AM better formatting
    Wednesday, May 2, 2012 6:46 AM