public void ConfigureExecute(IReceiveEndpointConfigurator configurator, IConfigurationServiceProvider configurationServiceProvider, Uri compensateAddress) { var activityScopeProvider = configurationServiceProvider.GetRequiredService <IExecuteActivityScopeProvider <TActivity, TArguments> >(); var activityFactory = new ScopeExecuteActivityFactory <TActivity, TArguments>(activityScopeProvider); var specification = new ExecuteActivityHostSpecification <TActivity, TArguments>(activityFactory, compensateAddress, configurator); configurator.ConfigureConsumeTopology = false; GetActivityDefinition(configurationServiceProvider) .Configure(configurator, specification); foreach (Action <IExecuteActivityConfigurator <TActivity, TArguments> > action in _executeActions) { action(specification); } LogContext.Debug?.Log("Configured endpoint {Endpoint}, Execute Activity: {ActivityType}", configurator.InputAddress.GetLastPart(), TypeMetadataCache <TActivity> .ShortName); configurator.AddEndpointSpecification(specification); }
public static void ExecuteActivityHost <TActivity, TArguments>(this IReceiveEndpointConfigurator configurator, IExecuteActivityFactory <TActivity, TArguments> factory, Action <IExecuteActivityConfigurator <TActivity, TArguments> > configure = null) where TActivity : class, IExecuteActivity <TArguments> where TArguments : class { if (configurator == null) { throw new ArgumentNullException(nameof(configurator)); } if (factory == null) { throw new ArgumentNullException(nameof(factory)); } LogContext.Debug?.Log("Configuring Execute Activity: {ActivityType}, {ArgumentType}", TypeMetadataCache <TActivity> .ShortName, TypeMetadataCache <TArguments> .ShortName); var specification = new ExecuteActivityHostSpecification <TActivity, TArguments>(factory, configurator); configure?.Invoke(specification); configurator.AddEndpointSpecification(specification); }