EventHubProducerClient 是否提供带有单个 EventData 的 SendAsync? [英] Does EventHubProducerClient offer SendAsync with single EventData?

查看:29
本文介绍了EventHubProducerClient 是否提供带有单个 EventData 的 SendAsync?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从官方文档看来,他们只支持批量发送.只是想知道是否存在某些东西(当然除了将一个作为列表发送)

It seems from the official documentation that they only support sending batch. Just curious to know if something exists (other than sending one as a list of course)

推荐答案

EventHubProduerClient 不提供发送单个事件的方法.在新 SDK 的设计过程中,我们了解到许多使用单事件重载的开发人员在对其应用程序的性能和吞吐量产生负面影响的情况下这样做.

The EventHubProduerClient does not offer a means to send a single event. During design of the new SDK, we learned that many of the developers using the the single event overload were doing so in scenarios where it had a negative impact on the performance and throughput of their application.

遗留重载只是简单地执行了一个隐式的 new[] { yourEvent } 并调用到 IEnumerable 重载,导致一个事件的分配和网络调用.相当大一部分使用它的开发人员告诉我们,他们假设客户端内有优化,可以将事件隐式分组并以有效的方式发布它们.

The legacy overload simply performed an implicit new[] { yourEvent } and called into the IEnumerable<EventData> overload, causing an allocation and network call for the one event. A fairly large portion of the developers using it let us know that they had assumed there were optimizations within the client to implicitly group events into batch and publish them in an efficient manner.

我们删除了该重载以反映实际行为并提高开发人员的意识,希望有助于鼓励考虑该场景的最佳模式.

We removed that overload to reflect the actual behavior and raise developer awareness, hopefully helping to encourage consideration of the best pattern for the scenario.

在某个时候,我们想恢复一个优化版本的单一事件发布,但我还不能说会采取什么形式或时间可能是什么.

At some point, we'd like to bring back an optimized version single event publishing, but I can't yet say what form that will take or what the timing may be.

这篇关于EventHubProducerClient 是否提供带有单个 EventData 的 SendAsync?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆