I'm using MassTransit to send and receive microservice commands. It sends and receives fine when I run it locally (connecting to the Azure Service Bus instance remotely). E.g. I send a command from a local console application to the remote ServiceBus queue (which I can see in Service Bus Explorer 3.0.4) and then my local TopShelf service receives and handles the command. But when I deploy my service it fails with the following error:
Microsoft.ServiceBus.Messaging.MessageSizeExceededException: The received message (delivery-id:0, size:1904586 bytes) exceeds the limit (262144 bytes) currently allowed on the link.
I'm only sending one message, and the message is rather big, but certainly not 1.8MB as mentioned in the error! It's only a little bigger than 100KB.
I found this post regarding batch partitioning of messages, but that seems to me only relevant if you want to split multiple messages into smaller groups of messages. I'm only sending one message. Also, I can't find any documentation in MassTransit on how to actually do that. I tried setting IServiceBusHostConfigurator
like this: cfg.BatchFlushInterval = TimeSpan.FromSeconds(0.05);
- Can someone explain why it thinks my messages are so much bigger?
- Am I able to split the single message into smaller partitions? Or is there a different solution?
- Should I disable partitioning altogether? If so, how?