任何人都在 net.msmq 上使用 protobuf-net 看到过这个问题

发布于 2024-09-16 14:11:03 字数 497 浏览 6 评论 0原文

我看到一个问题,我使用 protobuf-net 通过 wcf net.msmq 发送大消息并收到以下错误:

格式化程序在尝试反序列化消息时引发异常:反序列化操作“DeliverData”的请求消息正文时出错。预期名称空间 'http://mynamespace' 中的结束元素 'proto'

如果消息大小低于 16k,则它可以工作

如果我删除 protobuf -net,它可以工作

如果我切换到 basichttp,它可以工作

但是如果消息大小超过 16k,使用 protobuf-net,通过 net.msmq,我会收到错误。我已将 maxBufferPoolSize 和 maxReceivedMessageSize 设置得足够大,但没有帮助。

还有其他人看过这个吗?有没有其他人使用 protobuf-net + net.msmq 处理大消息并让它工作?

I am seeing a problem where I send large messages over wcf net.msmq using protobuf-net and get the following error:

The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'DeliverData'. End element 'proto' from namespace 'http://mynamespace' expected

If message size is under 16k, it works

If I remove protobuf-net, it works

If I switch to basichttp, it works

But if message size is over 16k, using protobuf-net, over net.msmq, I get the error. I have set maxBufferPoolSize and maxReceivedMessageSize sufficiently large, it does not help.

Has anyone else seen this? Has anyone else used protobuf-net + net.msmq for large messages and gotten it to work?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浅黛梨妆こ 2024-09-23 14:11:04

对于延迟(假期等)表示歉意。不,我还没有看到具体的问题。它调用“End 元素”的事实表明它当时位于 xml 层中(这是在 protobuf-net 真正参与之前)。你有什么办法可以可靠地重现这个吗?


经过调查,这里的问题似乎是WCF的读者配额;该异常似乎被 MSMQ 吞没,因此并不立即明显。这可以在配置中或代码中修复(如果您正在设置绑定)手动)通过引用 System.Runtime.Serialization 并适当增加绑定的 .ReaderQuotas.MaxArrayLength 。允许的最大值为 2147483647

Apologies for the delay - holiday etc. No, I haven't seen a specific problem with that. The fact that it calls out the "End element" suggests that it is in the xml layer at the time (which is before protobuf-net really gets involved). Do you have any way that I could reliably reproduce this?


After investigation, the problem here appears to be a WCF's reader-quotas; the exception appears to be swallowed by MSMQ, so wasn't immediately obvious. This can be fixed in configuration, or in code (if you are setting up your bindings manually) by referencing System.Runtime.Serialization and increasing the binding's .ReaderQuotas.MaxArrayLength appropriately. The maximum allowed value is 2147483647.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文