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

查看:69
本文介绍了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< EventData> 过载,从而导致对一个事件的分配和网络调用.相当一部分使用它的开发人员让我们知道,他们已经假设客户端内进行了优化,以将事件隐式分组为批并以有效的方式发布.

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天全站免登陆