/// <summary>
        /// Starts the transport.
        /// </summary>
        public void Start()
        {
            if (RoutableTransportMode == RoutableTransportMode.OnDemand)
            {
                int workersThreads;
                int ioThreads;
                ThreadPool.GetMaxThreads(out workersThreads, out ioThreads);
                ThreadPool.SetMaxThreads(100 * Environment.ProcessorCount, ioThreads);
                ThreadPool.SetMinThreads(50, 50);
            }

            CheckConfiguration();
            CreateQueuesIfNecessary();
            if (ErrorQueue != null)
            {
                _errorQueue = new MessageQueue(MsmqUtilities.GetFullPath(ErrorQueue));
            }
            if (!string.IsNullOrEmpty(InputQueue))
            {
                IPluginQueue inputQueue   = PluginQueueFactory.Create(InputQueue);
                IPluginQueue commandQueue = PluginQueueFactory.Create(UiCommandInputQueue);
                if (PurgeOnStartup)
                {
                    inputQueue.Purge();
                    commandQueue.Purge();
                }
                Logger.Info(LoggerContext.New(inputQueue.Name), "starting...");
                Logger.Info(LoggerContext.New(commandQueue.Name), "starting...");

                var factory = new MsmqRouterFactory(Logger, TimeSpan.FromSeconds(SecondsToWaitForMessage), GetTransactionTypeForSend, GetTransactionTypeForReceive());
                _inputQueueRouter = CreateAndStartMainMessageConsumer(factory);
                _uiQueueRouter    = CreateAndStartUiMessageConsumer(factory);
                Logger.Info(LoggerContext.New(inputQueue.Name), "started.");
                Logger.Info(LoggerContext.New(commandQueue.Name), "started.");
                _queue = inputQueue;
            }
        }
Exemplo n.º 2
0
        private void SendPluginInfoMessage()
        {
            var attribute = PluginMetadata.PluginData;

            Bus.Send(new PluginInfoMessage
            {
                Info = new PluginInfo(Context.PluginName)
                {
                    Category          = attribute.Category,
                    Description       = attribute.Description,
                    PluginInputQueue  = _pluginQueueFactory.Create(_pluginSettings.PluginInputQueue).IndependentAddressForQueue,
                    PluginIconContent = _pluginIcon.GetIconContent()
                }
            });
        }