Ejemplo n.º 1
0
        public async Task Should_be_able_to_handle()
        {
            await Bus.Publish <Ping>(new { });

            var context = await _handled;

            var entityName = new AmazonSqsMessageNameFormatter().GetMessageName(typeof(Ping));

            Assert.That(context.DestinationAddress, Is.EqualTo(new Uri($"amazonsqs://localhost/test/{entityName}")));
        }
Ejemplo n.º 2
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));
        }
Ejemplo n.º 3
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));
        }