Search code examples
.netazureservicebusmasstransit

MassTransit 3 w/ Azure - Consumer not receiving message > 8k


I have set up a C# solution using Masstransit 3.1.2 along with Azure Service Bus and everything seems to be working until I recently noticed that messages > 8k were not being received by my subscribers. I don't really see any errors. If the same message type was under 8k my message is received without any issues.

After much research, I'm fairly confident that this is a constraint with MassTransit and not Azure Service Bus since I can consume my message directly using the Azure SDK.

Is there a configuration setting that I'm missing? I'd hate to go the route of setting up an external message data like Mongo to receive these messages. My messages won't be more than 64k (which is Azure's standard limit, I believe).


Solution

  • Using the host configurator, you can try changing the TransportType to NetTcp (instead of the default AMQP) - there might be a limitation in the message size when using AMQP I'm not aware of - but honestly I've never seen the too big message issue and I know I've had messages larger than 8KB.

    host.TransportType = TransportType.NetMessaging;