I added a new worker role to our project to handle making outgoing phone calls. It draws the calls to make off a service bus queue.
I made a little console app to throw things onto the queue so that I could check to make sure it was working. Unfortunately it seems like whatever is put onto the queue by my app is instantly (or almost instantly?) put onto the dead letter queue. I took a look at the queue's properties and I can see
MessageCount 5
ActiveMessageCount 0
DeadLetterMessageCount 5
TransferMessageCount 0
AvailabilityStatus Available
EnableDeadLetteringOnMessageExpiration False
The worker role tries to get stuff off the queue, but all it's pulling is nulls.
The queue settings are the same as our other queue that's working. The object that I'm putting onto the queue is made up of almost all primitives, marked [MessageContract] and [Serializable]. All the members are marked [MessageHeader].
I also tried using the object that we use for our other queue just to see what would happen and that one dead-lettered right away too.
I don't get it. The object is clearly making it to the queue as the queue size is growing. But it just dead letters right away and I don't know what could cause that to happen besides the thing timing out.
Further Information: Took a look using Service Bus Explorer and it seems that the messages were being dead-lettered because MaxDeliveryCountExceeded. This seems to mean that if receiving a message fails more than 10 times it will shift it to the dead letter queue. So that parts solved, but I put a debug point in the worker role code and there's never any errors happening in there. My
BrokeredMessage message = Client.Receive()
always returns null so there's not even any time for it do anything wrong. I suppose something is going wrong in the actual Receive() call?