Ejemplo n.º 1
0
        public override Task Start()
        {
            if (PollerCanBeUsed())
            {
                var isAtMostOnce    = GetRequiredTransactionMode() == TransportTransactionMode.None;
                var maximumWaitTime = settings.Get <TimeSpan>(WellKnownConfigurationKeys.ReceiverMaximumWaitTimeWhenIdle);
                var peekInterval    = settings.Get <TimeSpan>(WellKnownConfigurationKeys.ReceiverPeekInterval);
                poller = new DelayedMessagesPoller(delayedDelivery.Table, connectionString, settings.ErrorQueueAddress(), isAtMostOnce, BuildDispatcher(), new BackoffStrategy(peekInterval, maximumWaitTime));
                nativeDelayedMessagesCancellationSource = new CancellationTokenSource();
                poller.Start(nativeDelayedMessagesCancellationSource.Token);
            }

            return(TaskEx.CompletedTask);
        }
Ejemplo n.º 2
0
        public void Start(CancellationToken cancellationToken = default)
        {
            if (!enabled)
            {
                return;
            }

            Logger.Debug("Starting delayed delivery poller");

            var isAtMostOnce = transportTransactionMode == TransportTransactionMode.None;

            poller = new DelayedMessagesPoller(
                delayedMessageStorageTable,
                blobServiceClient,
                errorQueueAddress,
                isAtMostOnce,
                dispatcher,
                backoffStrategy);

            // Start token is just passed through to the implementation which maintains its own token source for stopping
            poller.Start(cancellationToken);
        }