Beispiel #1
0
        public Task <IListener> CreateAsync(CancellationToken cancellationToken)
        {
            var triggerExecutor = new ServiceBusTriggerExecutor(_executor);
            var listener        = new ServiceBusListener(_entityPath, _isSessionsEnabled, triggerExecutor, _options, _account, _messagingProvider);

            return(Task.FromResult <IListener>(listener));
        }
Beispiel #2
0
        public Task <IListener> CreateAsync(CancellationToken cancellationToken)
        {
            var triggerExecutor = new ServiceBusTriggerExecutor(_executor);
            var listener        = new ServiceBusListener(_queueName, triggerExecutor, _config, _account);

            return(Task.FromResult <IListener>(listener));
        }
Beispiel #3
0
        public Task <IListener> CreateAsync(CancellationToken cancellationToken)
        {
            string entityPath = EntityNameHelper.FormatSubscriptionPath(_topicName, _subscriptionName);

            ServiceBusTriggerExecutor triggerExecutor = new ServiceBusTriggerExecutor(_executor);
            var listener = new ServiceBusListener(entityPath, triggerExecutor, _config, _account);

            return(Task.FromResult <IListener>(listener));
        }
        public ServiceBusListenerTests()
        {
            _mockExecutor = new Mock<ITriggeredFunctionExecutor>(MockBehavior.Strict);

            string testConnection = "Endpoint=sb://test.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=abc123=";
            MessagingFactory messagingFactory = MessagingFactory.CreateFromConnectionString(testConnection);
            OnMessageOptions messageOptions = new OnMessageOptions();
            _mockMessageProcessor = new Mock<MessageProcessor>(MockBehavior.Strict, messageOptions);
            
            ServiceBusConfiguration config = new ServiceBusConfiguration
            {
                MessageOptions = messageOptions
            };
            Mock<MessagingProvider> mockMessagingProvider = new Mock<MessagingProvider>(MockBehavior.Strict, config);
            config.MessagingProvider = mockMessagingProvider.Object;

            mockMessagingProvider.Setup(p => p.CreateMessageProcessor(_entityPath))
                .Returns(_mockMessageProcessor.Object);

            ServiceBusTriggerExecutor triggerExecutor = new ServiceBusTriggerExecutor(_mockExecutor.Object);
            _listener = new ServiceBusListener(messagingFactory, _entityPath, triggerExecutor, config);
        }
Beispiel #5
0
        public Task <IListener> CreateAsync(CancellationToken cancellationToken)
        {
            var listener = new ServiceBusListener(_descriptor.Id, _entityType, _entityPath, _isSessionsEnabled, _executor, _options, _account, _messagingProvider, _loggerFactory, _singleDispatch);

            return(Task.FromResult <IListener>(listener));
        }