internal OutboundMessageQueue(MessageCenter mc, IOptions <SiloMessagingOptions> options, SerializationManager serializationManager, ExecutorService executorService, ILoggerFactory loggerFactory)
        {
            messageCenter = mc;
            pingSender    = new SiloMessageSender("PingSender", messageCenter, serializationManager, executorService, loggerFactory);
            systemSender  = new SiloMessageSender("SystemSender", messageCenter, serializationManager, executorService, loggerFactory);
            senders       = new Lazy <SiloMessageSender> [options.Value.SiloSenderQueues];

            for (int i = 0; i < senders.Length; i++)
            {
                int capture = i;
                senders[capture] = new Lazy <SiloMessageSender>(() =>
                {
                    var sender = new SiloMessageSender("AppMsgsSender_" + capture, messageCenter, serializationManager, executorService, loggerFactory);
                    sender.Start();
                    return(sender);
                }, LazyThreadSafetyMode.ExecutionAndPublication);
            }
            logger  = loggerFactory.CreateLogger <OutboundMessageQueue>();
            stopped = false;
        }
        internal OutboundMessageQueue(MessageCenter mc, IMessagingConfiguration config)
        {
            messageCenter = mc;
            pingSender = new SiloMessageSender("PingSender", messageCenter);
            systemSender = new SiloMessageSender("SystemSender", messageCenter);
            senders = new Lazy<SiloMessageSender>[config.SiloSenderQueues];

            for (int i = 0; i < senders.Length; i++)
            {
                int capture = i;
                senders[capture] = new Lazy<SiloMessageSender>(() =>
                {
                    var sender = new SiloMessageSender("AppMsgsSender_" + capture, messageCenter);
                    sender.Start();
                    return sender;
                }, LazyThreadSafetyMode.ExecutionAndPublication);
            }
            logger = TraceLogger.GetLogger("Messaging.OutboundMessageQueue");
            stopped = false;
        }
Beispiel #3
0
        internal OutboundMessageQueue(MessageCenter mc, IMessagingConfiguration config)
        {
            messageCenter = mc;
            pingSender    = new SiloMessageSender("PingSender", messageCenter);
            systemSender  = new SiloMessageSender("SystemSender", messageCenter);
            senders       = new Lazy <SiloMessageSender> [config.SiloSenderQueues];

            for (int i = 0; i < senders.Length; i++)
            {
                int capture = i;
                senders[capture] = new Lazy <SiloMessageSender>(() =>
                {
                    var sender = new SiloMessageSender("AppMsgsSender_" + capture, messageCenter);
                    sender.Start();
                    return(sender);
                }, LazyThreadSafetyMode.ExecutionAndPublication);
            }
            logger  = TraceLogger.GetLogger("Messaging.OutboundMessageQueue");
            stopped = false;
        }
        internal OutboundMessageQueue(MessageCenter mc, IMessagingConfiguration config, SerializationManager serializationManager, ILoggerFactory loggerFactory)
        {
            messageCenter = mc;
            pingSender    = new SiloMessageSender("PingSender", messageCenter, serializationManager, loggerFactory);
            systemSender  = new SiloMessageSender("SystemSender", messageCenter, serializationManager, loggerFactory);
            senders       = new Lazy <SiloMessageSender> [config.SiloSenderQueues];

            for (int i = 0; i < senders.Length; i++)
            {
                int capture = i;
                senders[capture] = new Lazy <SiloMessageSender>(() =>
                {
                    var sender = new SiloMessageSender("AppMsgsSender_" + capture, messageCenter, serializationManager, loggerFactory);
                    sender.Start();
                    return(sender);
                }, LazyThreadSafetyMode.ExecutionAndPublication);
            }
            logger  = new LoggerWrapper <OutboundMessageQueue>(loggerFactory);
            stopped = false;
        }