public void Subscribe(IMessageHandler messageHandler)
        {
            var subscriptionId = $"{_configurationProvider.SubscriptionId}-{_configurationProvider.VmName}";

            _queueProvider
            .WithProject(_configurationProvider.ProjectId)
            .WithTopic(_configurationProvider.SubscriptionTopicId)
            .CreateSubscription(subscriptionId)
            .StartConsuming(messageHandler);
        }
Example #2
0
        public void Subscribe(IMessageHandler messageHandler)
        {
            _queueApi
            .WithProject(_configurationProvider.ProjectId)
            .WithTopic(_configurationProvider.SubscriptionTopicId)
            .CreateSubscription(_subscriptionId)
            .WithExponentialBackOff(60)
            .WithDeadLetter(_configurationProvider.DeadletterTopicId)
            .StartConsuming(messageHandler, true);

            _logger.Info($"Subscription setup to '{_subscriptionId}' for project '{_configurationProvider.ProjectId}'");
        }
        public void Given_Valid_Arguments_When_I_Call_WithProject_Then_It_Returns_Same_Instance_Of_Itself_Back()
        {
            //act
            var result = _sut.WithProject(_projectId);

            //assert
            Assert.IsNotNull(result);
            Assert.IsInstanceOf <IFluentQueueApi>(result);
            Assert.AreSame(_sut, result);
        }