public ServiceBusInstanceService(ITransportConfigurator transportConfigurator, IEnumerable <IServiceBusInstance> instances,
                                  string serviceName)
 {
     _transportConfigurator = transportConfigurator;
     _serviceName           = serviceName;
     _instances             = instances.ToArray();
 }
Ejemplo n.º 2
0
        public IServiceBus Start(ITransportConfigurator transportConfigurator)
        {
            OnStarting();

            try
            {
                _log.InfoFormat("{0} Starting Service Bus for Queue: {1}({2})", GetType().GetServiceDescription(), _queueName, _consumerLimit);

                IServiceBus bus = ServiceBusFactory.New(x =>
                {
                    transportConfigurator.Configure(x, _queueName, _consumerLimit);

                    x.Subscribe(s =>
                    {
                        foreach (SubscriptionBusServiceBuilderConfigurator builderConfigurator in _configurators)
                        {
                            s.AddConfigurator(builderConfigurator);
                        }
                    });
                });

                OnStarted(bus);

                _bus = bus;

                return(bus);
            }
            catch (Exception ex)
            {
                OnStartFailed(ex);
                throw;
            }
        }
 public ServiceBusInstanceService(ITransportConfigurator transportConfigurator, IEnumerable<IServiceBusInstance> instances,
     string serviceName)
 {
     _transportConfigurator = transportConfigurator;
     _serviceName = serviceName;
     _instances = instances.ToArray();
 }
Ejemplo n.º 4
0
        public IServiceBus Start(ITransportConfigurator transportConfigurator)
        {
            OnStarting();

            try
            {
                _log.InfoFormat("{0} Starting Service Bus for Queue: {1}({2})", GetType().GetServiceDescription(), _queueName, _consumerLimit);

                IServiceBus bus = ServiceBusFactory.New(x =>
                    {
                        transportConfigurator.Configure(x, _queueName, _consumerLimit);

                        x.Subscribe(s =>
                            {
                                foreach (SubscriptionBusServiceBuilderConfigurator builderConfigurator in _configurators)
                                    s.AddConfigurator(builderConfigurator);
                            });
                    });

                OnStarted(bus);

                _bus = bus;

                return bus;
            }
            catch (Exception ex)
            {
                OnStartFailed(ex);
                throw;
            }
        }
Ejemplo n.º 5
0
        public HostServiceBus(ITransportConfigurator transportConfigurator, HostServiceBusSettings settings)
        {
            _log.DebugFormat("Creating host service bus on queue: {0}", settings.QueueName);

            IServiceBus bus = ServiceBusFactory.New(x => transportConfigurator.Configure(x, settings.QueueName, 1));

            _bus = bus;
            _log.DebugFormat("host service bus created: {0}", _bus.Endpoint.Address.Uri);
        }
        public SendRetrieveImageCommandConfigurationSettings(IConfigurationProvider configurationProvider,
            ITransportConfigurator transportConfigurator)
        {
            string queueName;
            if (!configurationProvider.TryGetSetting("ImageRetrievalServiceQueueName", out queueName))
                throw new ArgumentException("The configuration setting ImageRetrievalServiceQueueName was not found");

            _imageRetrievalServiceAddress = transportConfigurator.GetQueueAddress(queueName);
        }
        public ImageServiceConfigurationSettings(IConfigurationProvider configurationProvider,
                                                 ITransportConfigurator transportConfigurator)
        {
            string queueName;

            if (!configurationProvider.TryGetSetting("ImageRetrievalTrackingQueueName", out queueName))
            {
                throw new ArgumentException("The configuration setting ImageRetrievalTrackingQueueName was not found");
            }

            _imageTrackingServiceAddress = transportConfigurator.GetQueueAddress(queueName);
        }
Ejemplo n.º 8
0
        public ExecuteActivityService(IConfigurationProvider configuration, ITransportConfigurator transportFactory,
                                      IActivityUriProvider activityUriProvider, ExecuteActivityFactory <TArguments> executeActivityFactory)
        {
            _log = Logger.Get(GetType());

            _transportFactory       = transportFactory;
            _activityUriProvider    = activityUriProvider;
            _executeActivityFactory = executeActivityFactory;

            _activityName = GetActivityName();

            _executeQueueName     = _activityUriProvider.GetExecuteActivityQueueName(_activityName);
            _executeConsumerLimit = GetExecuteConsumerLimit(configuration);
        }