I'm using a BrokeredMessage
containing a Stream
with a serialized object. According to the documentation the stream is part of the body not the header which is restricted to 64 KB. The overall message with about 67 KB is well below the limit of 256 KB for the message-size of ServiceBus queues.
I'm able to send a message and it shows up in the queue with the correct message-size.
After issuing the
Receive
-command the packet is removed from the queue and the counter is decremented accordingly. But, the operation runs into a timeout and returns anull
-pointer instead of theBrokeredMessage
.
I've tried with a packet with a size of 42 KB and all works well - sending, receiving and deserializing.
Q Why doesn't it work with the larger message and how can I make it work?
Edit 0
I tried receiving a byte
-array filled with a random pattern:
var bm = new BrokeredMessage(new byte[n])
n
= 63500 does work. (send:HeaderSize
= 53,BodySize
= 63572; receive:HeaderSize
= 139,BodySize
= 63572)n
= 64000 does not work. (send:HeaderSize
= 54,BodySize
= 64072; receive:null
)
Edit 1
@David Pfeffer It's just as simple as that:
var queueWork = QueueClient.CreateFromConnectionString(@"Endpoint=sb://***/;SharedAccessKeyName=***;SharedAccessKey=***", path, ReceiveMode.ReceiveAndDelete);
BrokeredMessage message = queueWork.Receive();