- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 Azure 事件中心,最初在发送数据以尝试计算批量大小时,我有类似于下面的代码,该代码将调用 EventData 。 GetBytes
EventHubClient client;//initialized before the relevant code
EventData curr = new EventData(data);
//Setting a partition key, and other operations.
long itemLength = curr.GetBytes().LongLength;
client.SendAsync(curr);
不幸的是,我在 SDK 代码中收到了异常。
The message body cannot be read multiple times. To reuse it store the value after reading.
虽然删除对 GetBytes 的最终不必要的调用意味着我可以发送消息,但发生此异常的理由相当令人费解。连续调用 GetBytes() 两次是重现相同异常的简单方法,但单次调用将意味着 EventData 无法成功发送。
看起来很可能在下面使用了 Message,并且如果作为 Message.GetBody 文档多次调用,则设置为抛出异常;但是,EventData 的方法 GetBodyStream 、 GetBody w/serializer 、 GetBody 或 GetBytes 中没有这方面的文档。
我想这应该被记录下来,或者被纠正,因为目前它在一个单独的线程中是一个令人不快的惊喜。
最佳答案
您是否尝试过使用 EventData.SerializedSizeInBytes 来获取大小?这是获取批处理计算大小的更准确方法。
关于azure - 为什么在发送之前不能调用EventData.GetBytes()?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27241679/
将 Azure.Messaging.EventHubs 从 5.5.0 升级到 5.9.0。 我需要将旧的 Microsoft.Azure.EventHubs.EventData 更改为 Azure.
在设置事件处理程序(提交、单击、按键等)时,将数据获取到处理程序并在处理程序中使用它的最快、最有效的方法是什么?我应该做这样的事情: $obj.data({name: value, ...}); $o
在 Azure 文档中 EventHubClient有two methods对于发送一批数据,它们每个都有下面的注释,并且会抛出 MessageSizeExceededException如果被忽略。
代码如下: -- Create a log table CREATE TABLE TriggerLog (LogInfo xml) -- Create a dummy
documentation没有任何关于如何使用 .submit( [eventData], handler(eventObject) ) 的示例 我有以下函数,我需要将 url 传递给 row_sav
如果使用 Azure EventHub 客户端 SDK 中的 EventHub.SendAsync(EventData),是否有办法找出哪个分区是写入的消息? 我们故意不提供分区键,以便 EventH
我试图通过查看安全事件日志来确定机器的最频繁用户。我正在考虑使用 4624 事件 ID,但我似乎无法弄清楚如何从查询中的 EventData 添加任何内容。我可以从 4624 事件中获取标准数据,但我
我有一些使用 Service Bus Event Data 的代码,并且我怀疑我需要使用 offset 属性,因为目前我的程序正在(或似乎)一遍又一遍地重新运行相同的事件中心数据。 我的代码如下: p
当前触发器如下: CREATE TRIGGER TestTrigger ON DATABASE FOR ALTER_TABLE AS BEGIN SET NOCOUNT ON; DECLARE
我正在使用 1x 函数,我的问题是,如果使用这个版本,我可以接收 EventData 类型的对象。 我已阅读有关它的文档,但我还不清楚。 执行函数时,抛出以下异常: mscorlib: Excepti
我正在创建一个由 EventHub 触发的 C# 隔离工作进程 Azure Function,该函数会将带有 header 的 EventData 列表输出到另一个 EventHub。 该函数在使用
从官方文档来看,他们只支持批量发送。只是想知道是否存在某些东西(当然除了作为列表发送一个之外) 最佳答案 EventHubProduerClient不提供发送单个事件的方法。在新 SDK 的设计过程中
从官方文档来看,他们只支持批量发送。只是想知道是否存在某些东西(当然除了作为列表发送一个之外) 最佳答案 EventHubProduerClient不提供发送单个事件的方法。在新 SDK 的设计过程中
我目前有一个像这样的 javascript 错误处理程序: window.onerror = function(msg, url, line){ //stuff }}; 但我希望能够像这样使用 jqu
给定一个 元素,我想在 blur 上调用一个现有的函数,并向它传递一个匿名回调。 案例一,简单的函数调用: function bar(){ alert("I am"); } $("#foo")
我通常按如下方式将数据发送到事件中心.. var encoded = Encoding.UTF8.GetBytes(serializedString); using (var edata = new
我有以下函数定义。 消息类型: type MailboxItem = { CustomerID: int AssetID: int } 代码: let Run(item: Mailbo
按照以下文章中的说明进行操作后 https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-first-azure
按照以下文章中的说明进行操作后 https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-first-azure
假设您使用 bind() 或 on() 将处理程序绑定(bind)到某个对象,并指定诸如 { color : "red"} 之类的数据>。后来,情况发生变化,您希望使用 { color : "blue
我是一名优秀的程序员,十分优秀!