public MessageSender(AzureServiceBusSettings serviceBusSettings,
                             ServiceBusConnection serviceBusConnection,
                             NamespaceInfo namespaceInfo,
                             MessageProcessingContext context,
                             string destinationQueue)
        {
            _messageProcessingContext = context;
            _settings      = serviceBusSettings;
            _namespaceInfo = namespaceInfo;

            // The default retry policy passed in to the sender provides an exponential backoff for transient failures.
            if (context == null)
            {
                _messageSender = new Microsoft.Azure.ServiceBus.Core.MessageSender(serviceBusConnection, destinationQueue, RetryPolicy.Default);
            }
            else
            {
                var viaQueue = context.GetMessageReceiver().Path;
                if (viaQueue == destinationQueue)
                {
                    _messageSender = new Microsoft.Azure.ServiceBus.Core.MessageSender(serviceBusConnection, destinationQueue, RetryPolicy.Default);
                }
                else
                {
                    _messageSender = new Microsoft.Azure.ServiceBus.Core.MessageSender(serviceBusConnection, destinationQueue, viaQueue, RetryPolicy.Default);
                }
            }
        }
 public QueueDeploymentManager(AzureServiceBusSettings settings, QueueDescription queueDescription)
 {
     _settings = settings;
     //Partitioning, TTL, lock duration, delivery count, etc
     _client           = new ManagementClient(_settings.ServiceBusConnectionString);
     _queueDescription = queueDescription;
 }
 public MessageProcessingContext(AzureServiceBusSettings settings,
                                 MessageReceiver messageReceiver,
                                 Message message,
                                 Message controlMessage,
                                 MessagingFactory factory,
                                 bool isTransactional)
 {
     _settings               = settings;
     _messageReceiver        = messageReceiver;
     _message                = message;
     _deferralControlMessage = controlMessage;
     _messagingFactory       = factory;
     _isTransactional        = isTransactional;
 }
        public PeekMessagePump(AzureServiceBusSettings settings,
                               IMessageHandlerFactory messageHandlerFactory,
                               ServiceBusConnection connection,
                               MessagingFactory messagingFactory,
                               string inputQueue)
        {
            _settings = settings;
            _messageHandlerFactory = messageHandlerFactory;
            _messagingFactory      = messagingFactory;

            // The RetryPolicy.Default supplied to the receiver uses an exponential backoff
            // for transient failures.
            _messageReceiver = new MessageReceiver(connection, inputQueue,
                                                   ReceiveMode.PeekLock, RetryPolicy.Default);
            _messageReceiver.PrefetchCount = _settings.PrefetchCount;
        }
 public MessagingFactoryBase(AzureServiceBusSettings settings)
 {
     Settings             = settings;
     ServiceBusConnection = new ServiceBusConnection(Settings.ServiceBusConnectionString);
 }
 public MessageSenderFactory(AzureServiceBusSettings settings)
     : base(settings)
 {
 }
 public MessagingFactory(AzureServiceBusSettings settings, IMessageHandlerFactory messageHandlerFactory)
     : base(settings)
 {
     _messageHandlerFactory = messageHandlerFactory;
 }