【问题标题】:Inconsistent ASP.NET WebHooks不一致的 ASP.NET WebHooks
【发布时间】:2017-08-17 16:16:11
【问题描述】:

我正在尝试设置 Azure WebJob 以使用自定义 WebHook 将数据推送到 Web 应用程序(然后将使用 SignalR 将其推送到客户端)。 WebJob 按计划运行(它轮询另一个服务以检查是否有任何新数据)。

我基于此 MSDN blog post,以及来自 MS 的 CustomSender.WebJobCustomReceiver 示例项目。

该系统在 Azure 上运行,并且大部分都可以正常工作,但并不一致。该作业每三分钟运行一次,并且始终发送 WebHook - 至少它始终记录此跟踪消息,我认为这意味着它正在发送 WebHook:

Configuring 'DataflowWebHookSender' with a total of 3 attempt(s) of sending WebHooks.

但是,WebHookHandler 并不总是收到 WebHook。有时我会收到下面的跟踪消息,有时什么也没有:

Processing incoming WebHook request with receiver 'custom' and id ''.

虽然很明显有很多地方可能会出现问题,但它间歇性地工作的事实让我认为代码和配置都很好,我对为什么处理程序有点卡住' t 更一致地接收 WebHook。期望 WebHooks 一直工作我错了吗?


Azure 日志流提取

2017-08-18T08:56:40  No new trace in the past 1 min(s).
2017-08-18T08:57:01  PID[15308] Information Configuring 'DataflowWebHookSender' with a total of 3 attempt(s) of sending WebHooks.
2017-08-18T08:58:40  No new trace in the past 1 min(s).
2017-08-18T08:59:40  No new trace in the past 2 min(s).
2017-08-18T09:00:02  PID[16092] Information Configuring 'DataflowWebHookSender' with a total of 3 attempt(s) of sending WebHooks.
2017-08-18T09:00:13  PID[15256] Information Registered 'IWebHookReceiver' instances with the following names: custom.
2017-08-18T09:00:13  PID[15256] Information Processing incoming WebHook request with receiver 'custom' and id ''.
2017-08-18T09:00:14  PID[15256] Information Registered configuration setting 'Custom' for ID '''.
2017-08-18T09:01:40  No new trace in the past 1 min(s).
2017-08-18T09:02:40  No new trace in the past 2 min(s).
2017-08-18T09:03:01  PID[15092] Information Configuring 'DataflowWebHookSender' with a total of 3 attempt(s) of sending WebHooks.
2017-08-18T09:04:40  No new trace in the past 1 min(s).
2017-08-18T09:05:40  No new trace in the past 2 min(s).
2017-08-18T09:06:00  PID[12892] Information Configuring 'DataflowWebHookSender' with a total of 3 attempt(s) of sending WebHooks.
2017-08-18T09:07:40  No new trace in the past 1 min(s).

【问题讨论】:

    标签: azure-web-app-service azure-webjobs asp.net-webhooks


    【解决方案1】:

    配置消息只是说发件人正在使用默认的重试策略进行初始化。在日志中查找的内容:

    1) 发件人是否生成了 webhook? 2) 接收方是否接收到 webhook? 3) 你能看到 webhook 传输过程中有任何错误或重试吗?

    亨里克

    【讨论】:

    • 谢谢亨利克。我已将 Azure 日志流的摘录添加到问题中。我已经为 Web 作业和 Web 应用程序设置了 ConsoleTraceListener,但这就是我所得到的 - 我需要寻找其他地方吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-12-12
    • 1970-01-01
    • 2020-10-11
    • 1970-01-01
    • 1970-01-01
    • 2016-05-09
    • 2010-10-30
    相关资源
    最近更新 更多