我想設置一個Azure WebJob來使用自定義WebHook將數據推送到Web應用程序(然後將它推送到使用SignalR的客戶端)。 WebJob按計劃運行(它輪詢另一個服務以檢查是否有任何新數據)。不一致的ASP.NET WebHooks
我已經基於此MSDN blog post,以及CustomSender.WebJob和CustomReceiver來自MS的示例項目。
該系統在Azure上運行,並且大多數都能正常工作,但並不一致。這項工作每三分鐘運行,並始終將網絡掛接 - 至少它總是記錄此跟蹤消息,我認爲意味着它發送網絡掛接:
Configuring 'DataflowWebHookSender' with a total of 3 attempt(s) of sending WebHooks.
然而WebHookHandler並不總是收到網絡掛接。有時候,我得到下面的跟蹤消息,有時什麼也沒有:
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).
感謝Henrik。我已經從Azure日誌流中添加了一個提取問題。我爲Web作業和Web應用程序都設置了一個ConsoleTraceListener,但這就是我所得到的 - 是否需要向別處尋找? –