Пример #1
0
        public BrokerEgressConfigurator WithExitPipeFitter <TConfigurator>() where TConfigurator : IPipeFitter
        {
            if (_configuration.ExitPipeFitterType != null)
            {
                throw ConfiguratorTools.MakeConfigurationMethodCalledMoreThanOnceException(
                          "exit pipe fitter type",
                          "broker egress",
                          nameof(WithExitPipeFitter));
            }

            _configuration.ExitPipeFitterType = typeof(TConfigurator);
            return(this);
        }
        public BrokerIngressConfigurator WithQueueNameMatcher <TMatcher>() where TMatcher : IQueueNameMatcher
        {
            if (_configuration.QueueNameMatcherType != null)
            {
                throw ConfiguratorTools.MakeConfigurationMethodCalledMoreThanOnceException(
                          "queue name matcher type",
                          "broker ingress",
                          nameof(WithQueueNameMatcher));
            }

            _configuration.QueueNameMatcherType = typeof(TMatcher);
            return(this);
        }
Пример #3
0
        public EgressApiConfigurator WithMessageKey <TMessageKey>()
        {
            if (_configuration.MessageKeyType != null)
            {
                throw ConfiguratorTools.MakeConfigurationMethodCalledMoreThanOnceException(
                          "message key type",
                          "broker egress API",
                          nameof(WithMessageKey));
            }

            _configuration.MessageKeyType = typeof(TMessageKey);
            return(this);
        }
        public BrokerIngressConfigurator WithEnterPipeFitter <TPipeFitter>() where TPipeFitter : IPipeFitter
        {
            if (_configuration.EnterPipeFitterType != null)
            {
                throw ConfiguratorTools.MakeConfigurationMethodCalledMoreThanOnceException(
                          "enter pipe fitter type",
                          "broker ingress",
                          nameof(WithEnterPipeFitter));
            }

            _configuration.EnterPipeFitterType = typeof(TPipeFitter);
            return(this);
        }
Пример #5
0
        public EgressApiConfigurator WithPipeFitter <TPipeFitter>() where TPipeFitter : IPipeFitter
        {
            if (_configuration.PipeFitterType != null)
            {
                throw ConfiguratorTools.MakeConfigurationMethodCalledMoreThanOnceException(
                          "pipe fitter",
                          "broker egress API",
                          nameof(WithPipeFitter));
            }

            _configuration.PipeFitterType = typeof(TPipeFitter);
            return(this);
        }
Пример #6
0
        public IngressApiConfigurator WithMessagePayload <TMessagePayload>()
        {
            if (_configuration.MessagePayloadType != null)
            {
                throw ConfiguratorTools.MakeConfigurationMethodCalledMoreThanOnceException(
                          "message payload type",
                          "broker ingress API",
                          nameof(WithMessagePayload));
            }

            _configuration.MessagePayloadType = typeof(TMessagePayload);
            return(this);
        }
Пример #7
0
        public EgressApiConfigurator WithMessageTypesRegistry <TMessageTypesRegistry>()
            where TMessageTypesRegistry : IEgressApiMessageTypesRegistry
        {
            if (_configuration.MessageTypesRegistryType != null)
            {
                throw ConfiguratorTools.MakeConfigurationMethodCalledMoreThanOnceException(
                          "message types registry type",
                          "broker egress API",
                          nameof(WithMessageTypesRegistry));
            }

            _configuration.MessageTypesRegistryType = typeof(TMessageTypesRegistry);
            return(this);
        }
Пример #8
0
        public IngressApiConfigurator WithHandlerRegistry <THandlerRegistryType>()
            where THandlerRegistryType : IHandlerRegistry
        {
            if (_configuration.HandlerRegistryType != null)
            {
                throw ConfiguratorTools.MakeConfigurationMethodCalledMoreThanOnceException(
                          "handler registry type",
                          "broker ingress API",
                          nameof(WithHandlerRegistry));
            }

            _configuration.HandlerRegistryType = typeof(THandlerRegistryType);
            return(this);
        }
Пример #9
0
        public IngressApiConfigurator WithQueueNamePatternsProvider <TQueueNamePatternsProvider>()
            where TQueueNamePatternsProvider : IQueueNamePatternsProvider
        {
            if (_configuration.QueueNamePatternsProviderType != null)
            {
                throw ConfiguratorTools.MakeConfigurationMethodCalledMoreThanOnceException(
                          "queue name patterns provider type",
                          "broker ingress API",
                          nameof(WithQueueNamePatternsProvider));
            }

            _configuration.QueueNamePatternsProviderType = typeof(TQueueNamePatternsProvider);
            return(this);
        }
Пример #10
0
        public MessageBrokerConfigurator WithId([NotNull] string id)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentNullException(nameof(id));
            }
            if (_configuration.Id != null)
            {
                throw ConfiguratorTools.MakeConfigurationMethodCalledMoreThanOnceException(
                          "ID",
                          "broker",
                          nameof(WithId));
            }

            _configuration.Id = id;
            return(this);
        }