Exemplo n.º 1
0
        private IHaveFulfilledSubscriptionRequirements TopicHandler <T>() where T : Message
        {
            ConfigureSqsSubscriptionViaTopic <T>();

            foreach (var region in Bus.Config.Regions)
            {
                var queue = _amazonQueueCreator.EnsureTopicExistsWithQueueSubscribedAsync(region, Bus.SerialisationRegister, _subscriptionConfig, Bus.Config.MessageSubjectProvider).GetAwaiter().GetResult();
                CreateSubscriptionListener <T>(region, queue);
                _log.LogInformation($"Created SQS topic subscription - Topic: {_subscriptionConfig.Topic}, QueueName: {_subscriptionConfig.QueueName}");
            }

            return(this);
        }
Exemplo n.º 2
0
        private IHaveFulfilledSubscriptionRequirements TopicHandler <T>() where T : Message
        {
            ConfigureSqsSubscriptionViaTopic <T>();

            foreach (string region in Bus.Config.Regions)
            {
                // TODO Make this async and remove GetAwaiter().GetResult() call
                var queue = _amazonQueueCreator.EnsureTopicExistsWithQueueSubscribedAsync(
                    region, Bus.SerializationRegister,
                    _subscriptionConfig,
                    Bus.Config.MessageSubjectProvider).GetAwaiter().GetResult();

                CreateSubscriptionListener <T>(region, queue);

                _log.LogInformation(
                    "Created SQS topic subscription on topic '{TopicName}' and queue '{QueueName}'.",
                    _subscriptionConfig.Topic,
                    _subscriptionConfig.QueueName);
            }

            return(this);
        }