public void Configure(Configure config)
        {
            this.Builder    = config.Builder;
            this.Configurer = config.Configurer;

            this.config = Configurer.ConfigureComponent <RabbitMqTransport>(ComponentCallModelEnum.Singleton);
            var cfg = NServiceBus.Configure.GetConfigSection <RabbitMqTransportConfig>();

            if (cfg != null)
            {
                this.config.ConfigureProperty(t => t.NumberOfWorkerThreads, cfg.NumberOfWorkerThreads);
                this.config.ConfigureProperty(t => t.MaximumNumberOfRetries, cfg.MaxRetries);
                this.config.ConfigureProperty(t => t.InputBroker, cfg.InputBroker);
                this.config.ConfigureProperty(t => t.InputExchange, cfg.InputExchange);
                this.config.ConfigureProperty(t => t.InputExchangeType, cfg.InputExchangeType);
                this.config.ConfigureProperty(t => t.InputQueue, cfg.InputQueue);
                this.config.ConfigureProperty(t => t.InputRoutingKeys, cfg.InputRoutingKeys);
                this.config.ConfigureProperty(t => t.DoNotCreateInputExchange, cfg.DoNotCreateInputExchange);
                this.config.ConfigureProperty(t => t.DoNotCreateInputQueue, cfg.DoNotCreateInputQueue);
                this.config.ConfigureProperty(t => t.ErrorBroker, cfg.ErrorBroker);
                this.config.ConfigureProperty(t => t.ErrorExchange, cfg.ErrorExchange);
                this.config.ConfigureProperty(t => t.ErrorExchangeType, cfg.ErrorExchangeType);
                this.config.ConfigureProperty(t => t.ErrorQueue, cfg.ErrorQueue);
                this.config.ConfigureProperty(t => t.ErrorRoutingKeys, cfg.ErrorRoutingKeys);
                this.config.ConfigureProperty(t => t.DoNotCreateErrorExchange, cfg.DoNotCreateErrorExchange);
                this.config.ConfigureProperty(t => t.DoNotCreateErrorQueue, cfg.DoNotCreateErrorQueue);

                this.config.ConfigureProperty(t => t.TransactionTimeout, TimeSpan.FromMinutes(cfg.TransactionTimeout));
                this.config.ConfigureProperty(t => t.SendAcknowledgement, cfg.SendAcknowledgement);
            }
        }
Beispiel #2
0
        public void Configure(Configure config)
        {
            Builder    = config.Builder;
            Configurer = config.Configurer;

            _receiverConfig =
                Configurer.ConfigureComponent <ServiceBrokerMessageReceiver>(DependencyLifecycle.SingleInstance);
            _senderConfig =
                Configurer.ConfigureComponent <ServiceBrokerMessageSender>(DependencyLifecycle.SingleInstance);
            _failureConfig =
                Configurer.ConfigureComponent <ServiceBrokerFailureManager>(DependencyLifecycle.SingleInstance);

            var cfg = GetConfigSection <ServiceBrokerTransportConfig>();

            if (cfg == null)
            {
                return;
            }

            ConnectionString(cfg.ConnectionString);
            SecondsToWaitForMessage(cfg.SecondsToWaitForMessage);
            InitiatorService(cfg.InitiatorService);
            ReceiveBatchSize(cfg.ReceiveBatchSize);
            EndConversationAfterReceive(cfg.EndConversationAfterReceive);
        }
Beispiel #3
0
        public IComponent Create(IComponentConfig config)
        {
            IComponent res = null;

            if (config is RestConfig)
            {
                res = new CustomRestComponent()
                {
                    Configuration = config, Db = DB
                }
            }
            ;
            else
            {
                if (config is StaticResourceConfig)
                {
                    res = new StaticResourceComponent()
                    {
                        Configuration = config
                    }
                }
                ;
            }
            res.Init();
            return(res);
        }
    }
        public void Configure(Configure config)
        {
            this.Builder = config.Builder;
            this.Configurer = config.Configurer;

            this.config = Configurer.ConfigureComponent<RabbitMqTransport>(ComponentCallModelEnum.Singleton);
            var cfg = NServiceBus.Configure.GetConfigSection<RabbitMqTransportConfig>();

            if(cfg != null)
            {
                this.config.ConfigureProperty(t => t.NumberOfWorkerThreads, cfg.NumberOfWorkerThreads);
                this.config.ConfigureProperty(t => t.MaximumNumberOfRetries, cfg.MaxRetries);
                this.config.ConfigureProperty(t => t.InputBroker, cfg.InputBroker);
                this.config.ConfigureProperty(t => t.InputExchange, cfg.InputExchange);
                this.config.ConfigureProperty(t => t.InputExchangeType, cfg.InputExchangeType);
                this.config.ConfigureProperty(t => t.InputQueue, cfg.InputQueue);
                this.config.ConfigureProperty(t => t.InputRoutingKeys, cfg.InputRoutingKeys);
                this.config.ConfigureProperty(t => t.DoNotCreateInputExchange, cfg.DoNotCreateInputExchange);
                this.config.ConfigureProperty(t => t.DoNotCreateInputQueue, cfg.DoNotCreateInputQueue);
                this.config.ConfigureProperty(t => t.ErrorBroker, cfg.ErrorBroker);
                this.config.ConfigureProperty(t => t.ErrorExchange, cfg.ErrorExchange);
                this.config.ConfigureProperty(t => t.ErrorExchangeType, cfg.ErrorExchangeType);
                this.config.ConfigureProperty(t => t.ErrorQueue, cfg.ErrorQueue);
                this.config.ConfigureProperty(t => t.ErrorRoutingKeys, cfg.ErrorRoutingKeys);
                this.config.ConfigureProperty(t => t.DoNotCreateErrorExchange, cfg.DoNotCreateErrorExchange);
                this.config.ConfigureProperty(t => t.DoNotCreateErrorQueue, cfg.DoNotCreateErrorQueue);

                this.config.ConfigureProperty(t => t.TransactionTimeout, TimeSpan.FromMinutes(cfg.TransactionTimeout));
                this.config.ConfigureProperty(t => t.SendAcknowledgement, cfg.SendAcknowledgement);
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="config"></param>
        public ComponentContainer(IComponentConfig config)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            mappings = config.ToMappings();
        }
Beispiel #6
0
    public void Configure(Configure config)
    {
      this.Builder = config.Builder;
      this.Configurer = config.Configurer;

      _config = Configurer.ConfigureComponent<RabbitMqTransport>(ComponentCallModelEnum.Singleton);
      _config.ConfigureProperty(t => t.NumberOfWorkerThreads, 1);
      _config.ConfigureProperty(t => t.MaximumNumberOfRetries, 3);
      _config.ConfigureProperty(t => t.TransactionTimeout, TimeSpan.FromMinutes(5));
    }
Beispiel #7
0
        public void Configure(Configure config)
        {
            Builder    = config.Builder;
            Configurer = config.Configurer;

            this.config = Configurer.ConfigureComponent <LocalRabbitMqSubscriptionStorage>(ComponentCallModelEnum.Singleton);
            var cfg = NServiceBus.Configure.GetConfigSection <LocalRabbitMqSubscriptionStorageConfig>();

            if (cfg != null)
            {
                //configure
            }
        }
        public void Configure(Configure config)
        {
            Builder = config.Builder;
            Configurer = config.Configurer;

            this.config = Configurer.ConfigureComponent<LocalRabbitMqSubscriptionStorage>(ComponentCallModelEnum.Singleton);
            var cfg = NServiceBus.Configure.GetConfigSection<LocalRabbitMqSubscriptionStorageConfig>();

            if(cfg != null)
            {
                //configure
            }
        }
        /// <summary>
        /// Applies property inject for the given type based on convention
        /// </summary>
        /// <typeparam name="T">The type</typeparam>
        /// <param name="config"></param>
        public void ApplyTo <T>(IComponentConfig config)
        {
            var targetType = typeof(T);

            foreach (var property in targetType.GetProperties())
            {
                var settingsKey = targetType.FullName + "." + property.Name;

                if (HasSetting(settingsKey))
                {
                    config.ConfigureProperty(property.Name, Get(settingsKey));
                }
            }
        }
        /// <summary>
        /// Wraps the given configuration object but stores the same 
        /// builder and configurer properties.
        /// </summary>
        /// <param name="config"></param>
        public void Configure(Configure config)
        {
            Builder = config.Builder;
            Configurer = config.Configurer;

            transportConfig =
                Configurer.ConfigureComponent<ServiceBrokerMessageReceiver>(DependencyLifecycle.SingleInstance);

            var cfg = GetConfigSection<ServiceBrokerTransportConfig>();
            if (cfg == null) return;

            transportConfig.ConfigureProperty(t => t.InputQueue, cfg.InputQueue);
            ConnectionString(cfg.ConnectionString);
        }
        /// <summary>
        /// Wraps the given configuration object but stores the same 
        /// builder and configurer properties.
        /// </summary>
        /// <param name="config"></param>
        public void Configure(Configure config)
        {
            Builder = config.Builder;
            Configurer = config.Configurer;

            transportConfig = Configurer.ConfigureComponent<ServiceBrokerMessageReceiver>(ComponentCallModelEnum.Singleton);

            var cfg = GetConfigSection<ServiceBrokerTransportConfig>();

            if (cfg != null)
            {
                transportConfig.ConfigureProperty(t => t.InputQueue, cfg.InputQueue);
                ConnectionString(cfg.ConnectionString);
            }
        }
        /// <summary>
        /// Wraps the given configuration object but stores the same 
        /// builder and configurer properties.
        /// </summary>
        /// <param name="config"></param>
        public void Configure(Configure config)
        {
            Builder = config.Builder;
            Configurer = config.Configurer;

            receiverConfig = Configurer.ConfigureComponent<OracleAQSMessageReceiver>(DependencyLifecycle.SingleInstance);
            senderConfig = Configurer.ConfigureComponent<OracleAQSMessageSender>(DependencyLifecycle.SingleInstance);

            var cfg = GetConfigSection<OracleAQSTransportConfig>();

            if (cfg != null)
            {
                receiverConfig.ConfigureProperty(t => t.InputQueue, cfg.InputQueue);
                receiverConfig.ConfigureProperty(t => t.QueueTable, cfg.QueueTable);
                ConnectionString(cfg.ConnectionString);
            }
        }
        /// <summary>
        /// Wraps the given configuration object but stores the same 
        /// builder and configurer properties.
        /// </summary>
        /// <param name="config"></param>
        public void Configure(Configure config)
        {
            Builder = config.Builder;
            Configurer = config.Configurer;

            transportConfig = Configurer.ConfigureComponent<OracleAQSTransport>(ComponentCallModelEnum.Singleton);

            var cfg = GetConfigSection<OracleAQSTransportConfig>();

            if (cfg != null)
            {
                transportConfig.ConfigureProperty(t => t.InputQueue, cfg.InputQueue);
                transportConfig.ConfigureProperty(t => t.NumberOfWorkerThreads, cfg.NumberOfWorkerThreads);
                transportConfig.ConfigureProperty(t => t.ErrorQueue, cfg.ErrorQueue);
                transportConfig.ConfigureProperty(t => t.MaxRetries, cfg.MaxRetries);
                transportConfig.ConfigureProperty(t => t.QueueTable, cfg.QueueTable);
                ConnectionString(cfg.ConnectionString);
            }
        }
        /// <summary>
        /// Wraps the given configuration object but stores the same 
        /// builder and configurer properties.
        /// </summary>
        /// <param name="config"></param>
        public void Configure(Configure config)
        {
            this.Builder = config.Builder;
            this.Configurer = config.Configurer;

            this.receiverConfig = this.Configurer.ConfigureComponent<OracleAqsMessageReceiver>(DependencyLifecycle.SingleInstance);
            this.senderConfig = this.Configurer.ConfigureComponent<OracleAqsMessageSender>(DependencyLifecycle.SingleInstance);

            var cfg = GetConfigSection<OracleAqsTransportConfig>();

            if (cfg != null)
            {
                this.ConnectionString(cfg.ConnectionString);
            }

            TimeoutMessageProcessor.MessageReceiverFactory = () => new OracleAqsMessageReceiver
            {
                ConnectionString = EndpointInputQueueInstaller.ConnectionString
            };
        }
        public void Configure(Configure config)
        {
            Builder = config.Builder;
            Configurer = config.Configurer;

            _receiverConfig =
                Configurer.ConfigureComponent<ServiceBrokerMessageReceiver>(DependencyLifecycle.SingleInstance);
            _senderConfig =
                Configurer.ConfigureComponent<ServiceBrokerMessageSender>(DependencyLifecycle.SingleInstance);
            _failureConfig =
                Configurer.ConfigureComponent<ServiceBrokerFailureManager>(DependencyLifecycle.SingleInstance);

            var cfg = GetConfigSection<ServiceBrokerTransportConfig>();
            if (cfg == null) return;

            ConnectionString(cfg.ConnectionString);
            SecondsToWaitForMessage(cfg.SecondsToWaitForMessage);
            InitiatorService(cfg.InitiatorService);
            ReceiveBatchSize(cfg.ReceiveBatchSize);
            EndConversationAfterReceive(cfg.EndConversationAfterReceive);
        }
Beispiel #16
0
 public TypeConfig(IComponentConfig config) {
   config_ = config;
 }
Beispiel #17
0
 public TypeConfig(IComponentConfig config)
 {
     config_ = config;
 }
Beispiel #18
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="config"></param>
 /// <returns></returns>
 public static ComponentContainer ToContainer(this IComponentConfig config)
 {
     return(new ComponentContainer(config));
 }