Example #1
0
 /// <summary>
 /// Initializes a new instance of the WssDispatcher class
 /// </summary>
 /// <param name="info">indicating the dispatcher info</param>
 /// <param name="binding">binding information</param>
 /// <param name="sharedData">indicating the shared data</param>
 /// <param name="observer">indicating the observer</param>
 /// <param name="queueFactory">indicating the queue factory</param>
 /// <param name="dispatcherIdle">set when the dispatcher enters idle status</param>
 public WssDispatcher(DispatcherInfo info, Binding binding, SharedData sharedData, BrokerObserver observer, BrokerQueueFactory queueFactory, SchedulerAdapterClientFactory schedulerAdapterClientFactory, AutoResetEvent dispatcherIdle)
     : base(info, binding, sharedData, observer, queueFactory, schedulerAdapterClientFactory, dispatcherIdle)
 {
     if (binding is BasicHttpBinding)
     {
         BasicHttpBinding httpBinding = binding as BasicHttpBinding;
         httpBinding.Security.Mode = BasicHttpSecurityMode.Message;
         httpBinding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.Certificate;
         httpBinding.Security.Message.AlgorithmSuite       = System.ServiceModel.Security.SecurityAlgorithmSuite.Basic128;
     }
     else
     {
         BrokerTracing.TraceWarning("[WssDispatcher]. The binding type is not HTTP {0}.", binding.GetType().ToString());
     }
 }
        /// <summary>
        /// Initializes a new instance of the AzureHttpsDispatcher class.
        /// </summary>
        /// <param name="azureQueueManager">AzureQueueManager instance</param>
        /// <param name="info">indicating the dispatcher info</param>
        /// <param name="binding">binding information</param>
        /// <param name="sharedData">indicating the shared data</param>
        /// <param name="observer">indicating the observer</param>
        /// <param name="queueFactory">indicating the queue factory</param>
        /// <param name="schedulerAdapterClientFactory">SchedulerAdapterClientFactory instance</param>
        /// <param name="dispatcherIdle">set when the dispatcher enters idle status</param>
        public AzureHttpsDispatcher(AzureQueueManager azureQueueManager, DispatcherInfo info, Binding binding, SharedData sharedData, BrokerObserver observer, BrokerQueueFactory queueFactory, SchedulerAdapterClientFactory schedulerAdapterClientFactory, AutoResetEvent dispatcherIdle)
            : base(info, ProxyBinding.BrokerProxyBinding, sharedData, observer, queueFactory, schedulerAdapterClientFactory, dispatcherIdle)
        {
            AzureDispatcherInfo azureDispatcherInfo = info as AzureDispatcherInfo;

            this.azureServiceName = azureDispatcherInfo.AzureServiceName;

            this.azureQueueManager = azureQueueManager;

            this.azureQueueManager.CreateRequestStorage(this.azureServiceName);

            this.responseStorageName =
                this.azureQueueManager.Start(azureDispatcherInfo.JobId, azureDispatcherInfo.RequeueCount);

            // Update backend binding's maxMessageSize settings with global maxMessageSize if its enabled (> 0)
            int maxMessageSize = sharedData.ServiceConfig.MaxMessageSize;

            if (maxMessageSize > 0)
            {
                BindingHelper.ApplyMaxMessageSize(binding, maxMessageSize);
            }

            this.backendBindingData = new BindingData(binding);
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the AzureDispatcher class
        /// </summary>
        /// <param name="info">indicating the dispatcher info</param>
        /// <param name="binding">binding information</param>
        /// <param name="sharedData">indicating the shared data</param>
        /// <param name="observer">indicating the observer</param>
        /// <param name="queueFactory">indicating the queue factory</param>
        /// <param name="dispatcherIdle">set when the dispatcher enters idle status</param>
        public AzureDispatcher(DispatcherInfo info, Binding binding, SharedData sharedData, BrokerObserver observer, BrokerQueueFactory queueFactory, SchedulerAdapterClientFactory schedulerAdapterClientFactory, AutoResetEvent dispatcherIdle)
            : base(info, ProxyBinding.BrokerProxyBinding, sharedData, observer, queueFactory, schedulerAdapterClientFactory, dispatcherIdle)
        {
            // Initialize proxy client pool
            this.proxyClientPool = this.AttachProxyClientPool(this.Epr, sharedData.Config.LoadBalancing.MaxConnectionCountPerAzureProxy);

            // Update backend binding's maxMessageSize settings with global maxMessageSize if its enabled (> 0)
            int maxMessageSize = sharedData.ServiceConfig.MaxMessageSize;

            if (maxMessageSize > 0)
            {
                BindingHelper.ApplyMaxMessageSize(binding, maxMessageSize);
            }

            this.backendBindingData = new BindingData(binding);
        }