将 StreamInsight 的输出获取到 ASP.NET 网页的简单方法是什么?

发布于 2024-09-29 20:53:57 字数 262 浏览 18 评论 0原文

我有一个 Twitter 数据流,正在由 Microsoft StreamInsight 进行解析和聚合。输出是一个数字(百分比)。理想情况下,在(向 Web 服务器)发出请求时,我希望从 StreamInsight 检索最新的百分比并在响应中使用它。

我知道我可以将 StreamInsight 输出适配器写入文件,然后读取该文件,但由于多种原因,这是错误的。我希望 ASP.NET 应用程序能够以某种方式实际连接到 StreamInsight 来轮询百分比。

有什么想法吗?

I have a stream of Twitter data that's being parsed and aggregated by Microsoft StreamInsight. The output is a single number (a percentage). Ideally, at the time of the request (to the web server), I'd like to retrieve the latest percentage from StreamInsight and use it in the response.

I know I could have a StreamInsight output adapter write to file, and then read the file, but that's just wrong for so many reasons. I'm hoping that an ASP.NET application can actually connect to StreamInsight in some way to poll for the percentage.

Any ideas?

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

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

发布评论

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

评论(2

烟凡古楼 2024-10-06 20:53:57

StreamInsight 只是工具包/框架,数据的形状或多或少是未知的 - 因此寻找 ASP.NET 直接连接到 StreamInsight 的方法将是徒劳的。

您的选择是:

  1. 实施一个托管多种服务器系统的输出适配器。例如 IIS Hostable Web Core、Socket Server 等。
  2. 实现调用外部有状态服务的输出适配器。例如,编写一个 IIS 应用程序,其中包含用于存储数据的静态变量、用于更新该变量状态的 Web 服务以及用于读取该变量的网页。
  3. 交换状态的其他方式 - 例如您已经拒绝的文件系统。

我已经完成了 #3 一次,也不喜欢它,遇到了锁定问题等。完成了 #2 几次 - 最终在输出适配器中实现了自定义 Web 服务和客户端,以线程安全的方式将数据写入内存,保留滚动列表等和 OData 解决方案来读取相同的数据,这样我就可以附加
PivotViewer

StreamInsight is just toolkit/framework, and the shape of your data is more or less unknown - so searching for a way for ASP.NET to directly connect to StreamInsight directly will be fruitless.

Your options are instead:

  1. Implement an output adapter that hosts some variety of server system. e.g. IIS Hostable Web Core, Socket Server etc.
  2. Implement an output adapter that calls an external stateful service. e.g. write a IIS application with a static variable to store your data, a webservice to update the state of that variable, and a webpage to read that variable.
  3. Some other way of exchanging state - like that filesystem you already rejected.

I've done #3 once, also didn't like it, had locking problems etc. Done #2 a couple of times - ended up with custom webservice and client implemented in an Output Adapter to write data in a threadsafe fashion into memory, keep a rolling list etc. and an OData solution to read the same data, so I could attach
PivotViewer.

终止放荡 2024-10-06 20:53:57

现在,您可以使用 SignalR 在任何客户端都可以订阅的集线器中发布消息。

Now you can use SignalR to publish messages in hubs that any client can subscribe to.

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