私はバックグラウンドタスクを実行するためにトリガされる連続して実行されているWebジョブを持っています。ジョブがトリガされて作業を実行すると、そのジョブが正常に完了したかどうかをトレースしたり、チェックする方法が見つけられません。QueueTriggerに追加されたメッセージのステータスを取得するには?
トリガーされたジョブのステータスを特定のメッセージで簡単に確認できる方法はありますか?
var taskId =_service.GetTaskId();
CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient();
CloudQueue _cloudQueue = queueClient.GetQueueReference("taskqueue");
_cloudQueue.CreateIfNotExists();
var taskInfo = new TaskInformation
{
TaskId = taskId,
};
var queueMessage = new CloudQueueMessage(JsonConvert.SerializeObject(taskInfo));
await _cloudQueue.AddMessageAsync(queueMessage);
// is it possible to get the status of the queueMessage here?
// Whether the queueMessage is completed running successfully or it has failed?
機能:
public async Task Process(
[QueueTrigger("taskqueue")] TaskInformation taskInfo, string id,
int dequeueCount)
{
//this process might take a while to complete...
await _application.Run(taskInfo.TaskId);
}
キューを使用している場合、メッセージが「x」回完了できなかった場合(設定可能)、ポイズンキューに移動します。これに基づいてイベントがトリガーされ、失敗したことが通知されます。 – lopezbertoni
機能を起動するためにキューが追加されたとき、そのメッセージが完了したかどうかを調べたいと思います。プロセスは何が起こったのかを知るために10分待つべきではありません。これは、タスクが完了したかどうかを見つけるために、時間間隔でアクションを照会するWebサイト上にあります。どんな良いアイデア? – akd