0

I have a long running PDF generation as part of a SAGA, so I read about the Turnout and I am trying to use it. However I have a complex consumer - several calls to DB, dependency on 3rd party service for generating the PDF and etc. I have troubles finding a good example how exactly I should use the Turnout endpoint.

My current usage is:

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}!");
                });
            });

However, the messages end up in the _skipped queue. I am doing something wrong and I cannot see it

dnmitev
  • 71
  • 10
  • 1
    How long is long running? And you don't use a consumer with Turnout, you use a simple method that returns a Task. You're creating the consumer yourself, I guess that's fine, but messages in skipped usually indicate an unconsumed type for that queue. – Chris Patterson Apr 28 '20 at 12:03
  • Sometimes it might take up to 3-4mins to generate this PDF. So to sum up.. I don't have the consumer in the Turnout configuration but rather the GeneratePDF method? – dnmitev Apr 28 '20 at 12:11
  • Well, [I guess](https://github.com/MassTransit/MassTransit/blob/develop/src/MassTransit/Turnout/IJobFactory.cs#L19) - honestly this code is 5 years old and hasn't been updated since so I don't know. – Chris Patterson Apr 28 '20 at 12:18

0 Answers0