internal ProcessSessionMessageEventArgs(
            ServiceBusReceivedMessage message,
            SessionReceiverManager manager,
            CancellationToken cancellationToken)
        {
            Message  = message;
            _manager = manager;

            // manager would be null in scenarios where customers are using the public constructor for testing purposes.
            _sessionReceiver  = (ServiceBusSessionReceiver)_manager?.Receiver;
            _receiveActions   = new ProcessorReceiveActions(message, manager, false);
            CancellationToken = cancellationToken;
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProcessMessageEventArgs"/> class.
        /// </summary>
        ///
        /// <param name="message">The message to be processed.</param>
        /// <param name="manager">The receiver manager for these event args.</param>
        /// <param name="cancellationToken">The processor's <see cref="System.Threading.CancellationToken"/> instance which will be cancelled
        /// in the event that <see cref="ServiceBusProcessor.StopProcessingAsync"/> is called.
        /// </param>
        internal ProcessMessageEventArgs(
            ServiceBusReceivedMessage message,
            ReceiverManager manager,
            CancellationToken cancellationToken)
        {
            Message = message;

            // manager would be null in scenarios where customers are using the public constructor for testing purposes.
            _receiver         = manager?.Receiver;
            CancellationToken = cancellationToken;

            bool autoRenew = manager?.ShouldAutoRenewMessageLock() == true;

            _receiveActions = new ProcessorReceiveActions(message, manager, autoRenew);
        }