Пример #1
0
        public void ConfigureConsumer(Type consumerType, IReceiveEndpointConfigurator configurator)
        {
            if (!Consumers.TryGetValue(consumerType, out var consumer))
            {
                throw new ArgumentException($"The consumer type was not found: {TypeMetadataCache.GetShortName(consumerType)}", nameof(consumerType));
            }

            consumer.Configure(configurator, this);
        }
Пример #2
0
        public void ConfigureSaga(Type sagaType, IReceiveEndpointConfigurator configurator)
        {
            if (!Sagas.TryGetValue(sagaType, out var saga))
            {
                throw new ArgumentException($"The saga type was not found: {TypeMetadataCache.GetShortName(sagaType)}", nameof(sagaType));
            }

            saga.Configure(configurator, this);
        }
Пример #3
0
        public void ConfigureActivity(Type activityType, IReceiveEndpointConfigurator executeEndpointConfigurator,
                                      IReceiveEndpointConfigurator compensateEndpointConfigurator)
        {
            if (!Activities.TryGetValue(activityType, out var activity))
            {
                throw new ArgumentException($"The activity type was not found: {TypeMetadataCache.GetShortName(activityType)}", nameof(activityType));
            }

            activity.Configure(executeEndpointConfigurator, compensateEndpointConfigurator, this);
        }
Пример #4
0
        public void ConfigureFuture(Type futureType, IReceiveEndpointConfigurator configurator)
        {
            if (!Futures.TryGetValue(futureType, out var future))
            {
                throw new ArgumentException($"The future type was not found: {TypeMetadataCache.GetShortName(futureType)}", nameof(futureType));
            }

            future.Configure(configurator, this);

            _configuredTypes.Add(futureType);
        }