Esempio n. 1
0
        public ConnectionContextFactory(AmazonSqsHostSettings settings, IAmazonSqsHostTopology topology)
        {
            _settings = settings;
            _topology = topology;

            _description = settings.ToString();
        }
Esempio n. 2
0
 public AmazonSqsConnectionContext(IConnection connection, IAmazonSqsHostConfiguration configuration, IAmazonSqsHostTopology hostTopology,
                                   CancellationToken cancellationToken)
     : base(cancellationToken)
 {
     _configuration = configuration;
     Topology       = hostTopology;
     Connection     = connection;
 }
Esempio n. 3
0
        public AmazonSqsHostConfiguration(IAmazonSqsBusConfiguration busConfiguration, AmazonSqsHostSettings settings, IAmazonSqsHostTopology topology)
        {
            Settings          = settings;
            _topology         = topology;
            _busConfiguration = busConfiguration;

            _host = new AmazonSqsHost(this);
        }
Esempio n. 4
0
        public AmazonSqsHost(IAmazonSqsHostConfiguration hostConfiguration, IAmazonSqsHostTopology hostTopology)
            : base(hostConfiguration, hostTopology)
        {
            _hostConfiguration = hostConfiguration;
            Topology           = hostTopology;

            Add(_hostConfiguration.ConnectionContextSupervisor);
        }
Esempio n. 5
0
        public AmazonSqsConnectionContext(IConnection connection, IAmazonSqsHostConfiguration configuration, IAmazonSqsHostTopology hostTopology,
                                          CancellationToken cancellationToken)
            : base(cancellationToken)
        {
            _configuration = configuration;
            Topology       = hostTopology;
            Connection     = connection;

            _taskScheduler = new LimitedConcurrencyLevelTaskScheduler(1);
        }
Esempio n. 6
0
        public ConnectionContextFactory(IAmazonSqsHostConfiguration configuration, IAmazonSqsHostTopology hostTopology)
        {
            _configuration = configuration;
            _hostTopology  = hostTopology;

            _connectionRetryPolicy = Retry.CreatePolicy(x =>
            {
                x.Handle <AmazonSqsConnectException>();

                x.Exponential(1000, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(3));
            });
        }
Esempio n. 7
0
        public AmazonSqsConnectionContext(IConnection connection, AmazonSqsHostSettings hostSettings, IAmazonSqsHostTopology topology, string description,
                                          CancellationToken cancellationToken)
            : base(new PayloadCache(), cancellationToken)
        {
            Connection   = connection;
            HostSettings = hostSettings;
            Topology     = topology;

            Description = description;

            _taskScheduler = new LimitedConcurrencyLevelTaskScheduler(1);
        }
Esempio n. 8
0
        public AmazonSqsHost(IAmazonSqsHostConfiguration hostConfiguration, IAmazonSqsHostTopology hostTopology)
            : base(hostConfiguration, hostTopology)
        {
            _hostConfiguration    = hostConfiguration;
            _hostTopology         = hostTopology;
            ConnectionRetryPolicy = Retry.CreatePolicy(x =>
            {
                x.Handle <AmazonSqsTransportException>();

                x.Exponential(1000, TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(3));
            });

            ConnectionContextSupervisor = new AmazonSqsConnectionContextSupervisor(hostConfiguration, hostTopology);
        }
Esempio n. 9
0
        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);

            _connectionContext = new Recycle <IConnectionContextSupervisor>(() => new ConnectionContextSupervisor(this, topologyConfiguration));
        }
Esempio n. 10
0
        public AmazonSqsHost(IAmazonSqsBusConfiguration busConfiguration, AmazonSqsHostSettings settings, IAmazonSqsHostTopology topology)
        {
            _settings = settings;
            _topology = topology;

            ReceiveEndpoints = new ReceiveEndpointCollection();

            ConnectionRetryPolicy = Retry.CreatePolicy(x =>
            {
                x.Handle <AmazonSqsTransportException>();

                x.Exponential(1000, TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(3));
            });

            ConnectionCache = new AmazonSqsConnectionCache(settings, _topology);

            ReceiveEndpointFactory = new AmazonSqsReceiveEndpointFactory(busConfiguration, this);
        }
Esempio n. 11
0
        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);

            ReceiveTransportRetryPolicy = Retry.CreatePolicy(x =>
            {
                x.Handle <AmazonSqsTransportException>();

                x.Exponential(1000, TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(3));
            });

            _connectionContext = new Recycle <IConnectionContextSupervisor>(() => new ConnectionContextSupervisor(this, topologyConfiguration));
        }
 public ConnectionContextFactory(IAmazonSqsHostConfiguration configuration, IAmazonSqsHostTopology hostTopology)
 {
     _configuration = configuration;
     _hostTopology  = hostTopology;
 }
Esempio n. 13
0
 public AmazonSqsHost(IAmazonSqsHostConfiguration hostConfiguration, IAmazonSqsHostTopology hostTopology)
     : base(hostConfiguration, hostTopology)
 {
     _hostConfiguration = hostConfiguration;
     Topology           = hostTopology;
 }
Esempio n. 14
0
 public AmazonSqsConnectionContextSupervisor(IAmazonSqsHostConfiguration configuration, IAmazonSqsHostTopology hostTopology)
     : base(new ConnectionContextFactory(configuration, hostTopology))
 {
 }
Esempio n. 15
0
 public AmazonSqsConnectionCache(AmazonSqsHostSettings settings, IAmazonSqsHostTopology topology)
     : base(new ConnectionContextFactory(settings, topology))
 {
     _description = settings.ToString();
 }