我正在尝试设置 Azure WebJob 以使用自定义 WebHook 将数据推送到 Web 应用程序(然后使用 SignalR 将其推送到客户端)。WebJob 按计划运行(它轮询另一个服务以检查是否有任何新数据)。
我基于此MSDN 博客文章以及 MS 的CustomSender.WebJob和CustomReceiver示例项目。
该系统在 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 ''.
虽然显然有很多地方可能存在问题,但它间歇性地工作的事实让我认为代码和配置都很好,我对为什么处理程序没有收到WebHooks 更加一致。期望 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).