0

We have a struct that we convert to a byte array and pack it into an MSMQ extension property. One of the values in the struct is a TimeToDelay value. We iterate over the received messages looking for a message with a TimeToDelay + arrivedTime value less than the current time. Basically, has the message been in the queue for at least TimeToDelay. If it has then we pull the message out and process it, so not FIFO. I've come across a situation where a customer has put the queue under load and some of the extension byte arrays are received as garbage. The byte array should look something like this:

4A-BF-CE-DB-EB-F3-29-41-BE-37-A5-27-1F-1F-3C-36-03-00-00-00-00-00-00-00-00-00-00-00-01-00-00-00

But instead it looks like:

53-6E-67-3D-48-64-72-2A-6E-6F-74-78-64-65-74-65-63-74-3D-54-72-75-65-2A-63-74-72-6C-67-75-69-64-3D-31-35-37-34-36-35-37-39-37-37-2A-61-70-70-49-64-3D-31-32-35-36-39-35-2A-6E-6F-64-65-69-64-3D-31-37-32-33-34-35-35-36

I've read all over that MSMQ can't be corrupted but I don't see any other explanation. The message is written as the first byte array every time. I also read that MSMQ should always be read FIFO but with no explanation as to why or what the side effect would be if we don't

Jakobitz
  • 71
  • 1
  • 5
  • 1
    Those bytes are the ASCII-encoded representation of the string `Sng=Hdr*notxdetect=True*ctrlguid=1574657977*appId=125695*nodeid=17234556` and not a binary payload. You may want to check if something is writing messages to a queue it's not supposed to (or using an extension property it's not supposed to). – Jeroen Mostert Feb 12 '20 at 21:14
  • Sorry for the confusion. I am printing those characters to the log just to track what the byte array looks like. The array looks the same for most messages except for a few of the bytes at the end because the TimeToDelay changes a little. Under load I'm seeing the large byte array and bad values when I map the byte array back to the struct on the other side. – Jakobitz Feb 13 '20 at 22:25

1 Answers1

0

I don't know if I should just delete this message but maybe it will help someone. After looking at months of logs I noticed a pattern. I put the byte array int a tool HxD to convert the bytes to something readable. I found that there were some variables set specifically to AppDynamics. I hope this is helpful to someone to know extensions can be shared by applications and how to look at extensions closer.

Jakobitz
  • 71
  • 1
  • 5