MSMQ 経由で Rebus へのメッセージ送信をトリガーするボタンを含むビューを提供する ASP.NET Web プロジェクトを使用しています。メッセージ ハンドラーは長時間実行される操作 (15 ~ 30 分) であり、メッセージの処理中に rebus コマンド ハンドラーが Web に更新を送信するようにしたいと考えています。
public void Handle(ImportProducts message)
{
_bus.Send(new CommandStatusReply("Starting up import products job..."));
// One operation that takes about a minute
_bus.Send(new CommandStatusReply("Step one completed. processing..."));
// Another operation that takes a while
...
}
私の Web アプリケーションには、SignalR を介してクライアントにステータス メッセージをプッシュする CommandStatusReply のハンドラーがあります。ImportProducts メッセージが処理されたときに、すべての CommandStatusReply メッセージが「バッチで」送信されることを除いて、すべてが機能します。代わりにすぐに送ってほしいです。これは可能ですか?その場合、何が欠けていますか?
Bus.Send()、Bus.Reply()、および Bus.Publish() を試しましたが、Bus.Reply/Send を TransactionScope(TransactionScopeOptions.Suppress) でラップしようとしても無駄でした。