c# - 在将 JSON 字符串提交到 Azure 队列之前找到它的大小
问题描述
我正在创建一个 JSON 字符串以传递给 Azure 消息队列,但它不能大于 64k
我想在提交之前检查尺寸。
这是使用 Newtonsoft 创建它的代码
//add list of stops to StopsList class object
StopsList stops = new StopsList() { LOBstops = stopsList };
// Serialize using Newtonsoft.Json
string jsonString = JsonConvert.SerializeObject(stops);
//Insert it into the queue for processing
insertQueueMessage(messageToInsert: jsonString, queueName: queueToUse);
解决方案
推荐阅读
- python - 如何从同一行中找到不同列的不同值
- python - 使用 Python 请求模块的 SSL 或代理错误
- vb.net - 如何让应用程序检查应用程序目录中是否存在 EXE 文件?
- c++ - VS profiler,源信息不可用
- python - 分组和旋转数据框
- python-3.x - 公钥加密是否可以用于保护此 OpenId Connect 工作流程的最后一站
- reactjs - 优化组件 React Hooks 中的计算
- c++ - 将字符串转换为 Arduino 的字符
- node.js - 尝试在 mp3 上使用 LAME - 获得 MPEG-2.5 仅受 Layer3 支持
- python - Python - 从服务总线主题读取消息,然后将它们存储在具有相同名称的容器中