protected AzureServiceBusQueueClient(AzureServiceBusQueueEndpoint endpoint,
                                             IAzureServiceBusConfiguration sbConfiguration)
            : base(sbConfiguration)
        {
            if (endpoint == null)
                throw new ArgumentNullException("endpoint");

            endpoint.Validate();

            QueueEndpoint = endpoint;

            try
            {
                if (NsManager.QueueExists(endpoint.QueueName) == false)
                    NsManager.CreateQueue(endpoint.QueueName);

                QueueClient = QueueClient.CreateFromConnectionString(sbConfiguration.ConnectionString,
                                                                     endpoint.QueueName);

                QueueClient.RetryPolicy = RetryExponential.Default;
            }
            catch (Exception ex)
            {
                throw new MessagingException(
                    String.Format(
                        "An error occurred while attempting to access the specified Azure service bus queue [{0}]. See inner exception for more details.",
                        endpoint.QueueName),
                    ex);
            }
        }
示例#2
0
        protected AzureServiceBusQueueClient(AzureServiceBusQueueEndpoint endpoint,
                                             IAzureServiceBusConfiguration sbConfiguration)
            : base(sbConfiguration)
        {
            if (endpoint == null)
            {
                throw new ArgumentNullException("endpoint");
            }

            endpoint.Validate();

            QueueEndpoint = endpoint;

            try
            {
                if (NsManager.QueueExists(endpoint.QueueName) == false)
                {
                    NsManager.CreateQueue(endpoint.QueueName);
                }

                QueueClient = QueueClient.CreateFromConnectionString(sbConfiguration.ConnectionString,
                                                                     endpoint.QueueName);

                QueueClient.RetryPolicy = RetryExponential.Default;
            }
            catch (Exception ex)
            {
                throw new MessagingException(
                          String.Format(
                              "An error occurred while attempting to access the specified Azure service bus queue [{0}]. See inner exception for more details.",
                              endpoint.QueueName),
                          ex);
            }
        }
        protected AzureServiceBusQueueEndpointManager(AzureServiceBusQueueEndpoint endpoint,
                                                      IAzureServiceBusConfiguration sbConfiguration)
            : base(sbConfiguration)
        {
            if (endpoint == null)
                throw new ArgumentNullException("endpoint");

            endpoint.Validate();

            this.endpoint = endpoint;
        }
        protected AzureServiceBusQueueEndpointManager(AzureServiceBusQueueEndpoint endpoint,
                                                      IAzureServiceBusConfiguration sbConfiguration)
            : base(sbConfiguration)
        {
            if (endpoint == null)
            {
                throw new ArgumentNullException("endpoint");
            }

            endpoint.Validate();

            this.endpoint = endpoint;
        }