0

作为 SAGA 的一部分,我有一个长期运行的 PDF 生成,所以我阅读了有关 Turnout 的信息,并且我正在尝试使用它。但是我有一个复杂的消费者 - 多次调用 DB,依赖 3rd 方服务来生成 PDF 等等。我很难找到一个很好的例子,我应该如何准确地使用 Turnout 端点。

我目前的用法是:

c.TurnoutEndpoint<PdfGenerationCommand>(host, "pdf-generation-TURNOUT", e =>
            {
                e.SuperviseInterval = TimeSpan.FromSeconds(30);
                e.SetJobFactory(async context =>
                {
                    var consumer = container.GetInstance<PdfGenerationCommandConsumer>();
                    var sw = new Stopwatch();
                    sw.Start();

                    Console.WriteLine($"{DateTime.Now} - [PdfGenerationCommand] Job started!");
                    await consumer.Consume(context.Command).ConfigureAwait(false);
                    sw.Stop();
                    Console.WriteLine($"{DateTime.Now} - [PdfGenerationCommand] Job finished in {sw.ElapsedMilliseconds}!");
                });
            });

但是,消息最终会出现在 _skipped 队列中。我做错了什么,我看不到它

4

0 回答 0