示例#1
0
        public void Init(MQPairConfig config)
        {
            if (config is null)
            {
                return;
            }
            StopListeners();
            QueueServerListeners.Clear();

            Config   = config;
            Name     = Config.Name;
            Counters = new MQRawServerCounters(Name, Config.IgnoreServerCounters);
            OnInit();

            Core.Status.Attach(collection =>
            {
                if (QueueServerListeners?.Any() != true)
                {
                    return;
                }
                foreach (var listener in QueueServerListeners)
                {
                    Core.Status.AttachChild(listener, this);
                }
            });
        }
示例#2
0
 protected MQueueRawServerBase()
 {
     Counters = new MQRawServerCounters();
     Core.Status.Attach(collection =>
     {
         collection.Add("Type", GetType().FullName);
     });
 }
示例#3
0
 protected MQueueRawServerListenerBase(MQConnection connection, IMQueueRawServer server, bool responseServer)
 {
     Connection         = connection;
     Config             = server.Config;
     Counters           = new MQRawServerCounters(server.Name + "\\Listener (" + connection?.Route + ")", server.Config.IgnoreServerCounters);
     ReceiverSerializer = server.ReceiverSerializer;
     ResponseServer     = responseServer;
     Core.Status.Attach(collection =>
     {
         collection.Add("Connection Route:", Connection?.Route);
         collection.Add("Connection Name:", Connection?.Name);
         collection.Add(nameof(ResponseServer), ResponseServer);
         Core.Status.AttachChild(Counters, this);
     });
 }