gpt4 book ai didi

azure - 如何在 Azure 上为匿名 HTTP API 消息创建代理?

转载 作者:行者123 更新时间:2023-12-03 05:07:27 24 4
gpt4 key购买 nike

我们需要 Azure 上的 API 来存储通过 HTTP 发送给它(代理)的消息,以防我的系统(云服务)不可用或数据库繁忙。更改要发送的确切消息并不容易。在 Azure 上如何打造这样的经纪人?

服务总线队列看起来很有趣,但它需要 Shared Access Signatures据我了解。

另一个 WebRole 应该是一个解决方案,但需要时间来实现。

使用某种工具(MSMQ?)的虚拟机似乎是一种方法,但需要维护。

你觉得怎么样?

最佳答案

您的场景是应用以队列为中心的工作模式的主要候选方案。

来自http://www.asp.net/aspnet/overview/developing-apps-with-windows-azure/building-real-world-cloud-apps-with-windows-azure/queue-centric-work-pattern :

Loosely Coupled

如果您的工作线程或数据库不可用,消息仍会放置在持久存储中并稍后使用。

任务队列可以采用 Azure 存储队列或服务总线队列的形式。在每一个伟大的设计中,最简单的组件都能胜出。在这种情况下,这将是 Azure 存储队列,耐用、可靠、移动部件很少。除非您绝对需要精确的 FIFO 排序,在这种情况下您可以使用服务总线。

来自https://msdn.microsoft.com/en-us/library/dn568101.aspx :

This solution offers the following benefits:

  • It enables an inherently load-leveled system that can handle wide variations in the volume of requests sent by application instances. The queue acts as a buffer between the application instances and the consumer service instances, which can help to minimize the impact on availability and responsiveness for both the application and the service instances (as described by the Queue-based Load Leveling pattern). Handling a message that requires some long-running processing to be performed does not prevent other messages from being handled concurrently by other instances of the consumer service.

  • It improves reliability. If a producer communicates directly with a consumer instead of using this pattern, but does not monitor the consumer, there is a high probability that messages could be lost or fail to be processed if the consumer fails. In this pattern messages are not sent to a specific service instance, a failed service instance will not block a producer, and messages can be processed by any working service instance.

  • It does not require complex coordination between the consumers, or between the producer and the consumer instances. The message queue ensures that each message is delivered at least once.

  • It is scalable. The system can dynamically increase or decrease the number of instances of the consumer service as the volume of messages fluctuates.

  • It can improve resiliency if the message queue provides transactional read operations. If a consumer service instance reads and processes the message as part of a transactional operation, and if this consumer service instance subsequently fails, this pattern can ensure that the message will be returned to the queue to be picked up and handled by another instance of the consumer service.

关于azure - 如何在 Azure 上为匿名 HTTP API 消息创建代理?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38590804/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com