public ServiceBusSubscriptionListener(Func <ServiceBusSubscriptionListenerModel, Task> callback)
        {
            _callback = callback;
            _serviceBusConnectionString = ConfigHelper.Get(_configSectionName, _serviceBusConnectionStringName);
            _subscriptionClient         = SubscriptionClient.CreateFromConnectionString(
                _serviceBusConnectionString,
                ConfigHelper.Get(_configSectionName, _topicParameterName),
                ConfigHelper.Get(_configSectionName, _subscriptionParameterName));

            _logger = LoggerManager.CreateDefaultLogger();
        }
Пример #2
0
        /// <summary>
        /// Optional override to create listeners (e.g., TCP, HTTP) for this service replica to handle client or user requests.
        /// </summary>
        /// <returns>A collection of listeners.</returns>
        protected override IEnumerable <ServiceInstanceListener> CreateServiceInstanceListeners()
        {
            yield return(new ServiceInstanceListener(context => new ServiceBusQueueListeners(ProcessMessageHandler,
                                                                                             _serviceBusConnectionString, _queueName, LoggerManager.CreateDefaultLogger()), "StatelessService-ServiceBusQueueListener"));

            //return new ServiceInstanceListener[0];
        }