Estimating JSON size
- 📅
- 📝 990 words
- 🕙 5 minutes
- 📦 .NET
- 🏷️ JSON, C#
- 💬 2 responses
I’ve been working on a system that heavily uses message queuing (RabbitMQ via MassTransit specifically) and occasionally the system needs to deal with large object graphs that need to be processed different — either broken into smaller pieces of work or serialized to an external source and a pointer put into the message instead.
The first idea was to serialize all messages to a MemoryStream but unfortunately this has some limitations, specifically: