Example #1
0
        public ServiceBusHost(IServiceBusHostConfiguration hostConfiguration, IServiceBusHostTopology hostTopology)
            : base(hostConfiguration, hostTopology)
        {
            _hostConfiguration = hostConfiguration;
            _hostTopology      = hostTopology;

            RetryPolicy = Retry.CreatePolicy(x =>
            {
                x.Ignore <MessagingEntityNotFoundException>();
                x.Ignore <MessagingEntityAlreadyExistsException>();
                x.Ignore <MessageNotFoundException>();
                x.Ignore <MessageSizeExceededException>();

                x.Handle <ServerBusyException>(exception => exception.IsTransient);
                x.Handle <TimeoutException>();

                x.Interval(5, TimeSpan.FromSeconds(10));
            });

            ConnectionContextSupervisor = new ConnectionContextSupervisor(hostConfiguration);

            var cacheSettings = new CacheSettings(SendEndpointCacheDefaults.Capacity, SendEndpointCacheDefaults.MinAge, SendEndpointCacheDefaults.MaxAge);

            var cache = new GreenCache <CachedSendTransport>(cacheSettings);

            _index = cache.AddIndex("key", x => x.Address);
        }
Example #2
0
        void IProbeSite.Probe(ProbeContext context)
        {
            var scope = context.CreateScope("host");

            scope.Set(new
            {
                Type = "RabbitMQ",
                Settings.Host,
                Settings.Port,
                Settings.VirtualHost,
                Settings.Username,
                Password = new string('*', Settings.Password.Length),
                Settings.Heartbeat,
                Settings.Ssl
            });

            if (Settings.Ssl)
            {
                scope.Set(new
                {
                    Settings.SslServerName
                });
            }

            ConnectionContextSupervisor.Probe(scope);

            _receiveEndpoints.Probe(scope);
        }
        public ActiveMqHostConfiguration(IActiveMqBusConfiguration busConfiguration, IActiveMqTopologyConfiguration topologyConfiguration)
            : base(busConfiguration)
        {
            _busConfiguration = busConfiguration;

            _hostSettings = new ConfigurationHostSettings(new Uri("activemq://localhost"));
            _hostTopology = new ActiveMqHostTopology(this, topologyConfiguration);

            ConnectionContextSupervisor = new ConnectionContextSupervisor(this, topologyConfiguration);
        }
Example #4
0
        protected override void Probe(ProbeContext context)
        {
            context.Set(new
            {
                Type = "Azure Service Bus",
                _hostConfiguration.HostAddress,
                _hostConfiguration.Settings.OperationTimeout
            });

            ConnectionContextSupervisor.Probe(context);
        }
        public AmazonSqsHostConfiguration(IAmazonSqsBusConfiguration busConfiguration, IAmazonSqsTopologyConfiguration
                                          topologyConfiguration)
            : base(busConfiguration)
        {
            _busConfiguration      = busConfiguration;
            _topologyConfiguration = topologyConfiguration;

            _hostSettings = new ConfigurationHostSettings();

            var messageNameFormatter = new AmazonSqsMessageNameFormatter();

            _hostTopology = new AmazonSqsHostTopology(this, messageNameFormatter, topologyConfiguration);

            ConnectionContextSupervisor = new ConnectionContextSupervisor(this, topologyConfiguration);
        }
Example #6
0
        public RabbitMqHostConfiguration(IRabbitMqBusConfiguration busConfiguration, IRabbitMqTopologyConfiguration topologyConfiguration)
            : base(busConfiguration)
        {
            _busConfiguration = busConfiguration;
            _hostSettings     = new ConfigurationHostSettings
            {
                Host        = "localhost",
                VirtualHost = "/",
                Port        = 5672,
                Username    = "******",
                Password    = "******"
            };

            var exchangeTypeSelector = topologyConfiguration.Publish.ExchangeTypeSelector;
            var messageNameFormatter = new RabbitMqMessageNameFormatter();

            _hostTopology = new RabbitMqHostTopology(this, exchangeTypeSelector, messageNameFormatter, _hostSettings.HostAddress, topologyConfiguration);

            ConnectionContextSupervisor = new ConnectionContextSupervisor(this, topologyConfiguration);
        }
Example #7
0
        protected override void Probe(ProbeContext context)
        {
            context.Set(new
            {
                Type = "RabbitMQ",
                Settings.Host,
                Settings.Port,
                Settings.VirtualHost,
                Settings.Username,
                Password = new string('*', Settings.Password.Length),
                Settings.Heartbeat,
                Settings.Ssl
            });

            if (Settings.Ssl)
            {
                context.Set(new { Settings.SslServerName });
            }

            ConnectionContextSupervisor.Probe(context);
        }
Example #8
0
        protected override async Task StopSupervisor(StopSupervisorContext context)
        {
            await base.StopSupervisor(context).ConfigureAwait(false);

            await ConnectionContextSupervisor.Stop(context).ConfigureAwait(false);
        }