Retry for activities in Courier using Autofac

80 views
Skip to first unread message

poptartsareart

unread,
Feb 24, 2018, 12:02:51 PM2/24/18
to masstransit-discuss
Hey All, 

I have a routing slip with a couple of activities. 

These need to get resovled out of an autofac container. 

Each activity has individual retry policies. 

This currently does not seem to be supported? The autofac extension do not offer access to the configurator. 

I have grabbed the code from the autofac extension and added the retry poliocy to the endpoint specification (see below)

This works as expected - I am just not sure if this is best-practice and/if I might be in for a world of hurt when this goes to production. 

I can send a PR with an override to the autofac extensions ? Or am i just doing this wrong. 

Thanks 

HW
   
// Autofac
builder
.RegisterType<SendExternalOneActivity>();

// Bus Config

     sbc
.ReceiveEndpoint(host, executeSendExternalOneEndpoint, e =>
            {
               
// https://github.com/MassTransit/MassTransit/blob/bcd4a554b9ffebd05e30b89e8a3c5493137a1a36/src/MassTransit.Host/Activities/ActivityServiceBootstrapper.cs
               
// https://github.com/MassTransit/MassTransit/commit/19421265cde09c77619be278fe9f9b5ff232bdaf
               
var factory = new AutofacExecuteActivityFactory<SendExternalOneActivity, SendExternalOneActivityArguments>(
                    context.Resolve<ILifetimeScope>(), "execute-SendExternalOne-activity");

               
var specification = new ExecuteActivityHostSpecification<SendExternalOneActivity, SendExternalOneActivityArguments>(
                    factory, compensateSendExternalOneEndpoint);

                specification
.UseRetry(configurator => configurator.Immediate(5));

                e
.AddEndpointSpecification(specification);
           
});

Chris Patterson

unread,
Feb 24, 2018, 12:04:52 PM2/24/18
to masstrans...@googlegroups.com
There is an open issue around the retry configuration of routing slip hosts (both execute and compensate).

I need to get that sorted out, which should make it work as expected.


--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.
To post to this group, send email to masstransit-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/d8036589-ba5b-4f66-a86d-49c5f804a2c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages