Search code examples
msmqfirewalldata-integritytransactional-queue

Does msmq ensure data integrity on transactional queues?


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:

try
{
    var message = queue.Receive(readTimeout, transaction);
    if (message != null)
    {
        data = (byte[]) message.Body; // this line raises an exception
        return true;
    }
}
catch (Exception e)
{
    Logger.Error("error reading queue", e);
}

I had to delete a few messages from (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?


Solution

  • It currently looks like MSMQ entirely "trusts" the TCP layer when it comes to data integrity and completeness.