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

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

            OnInit();

            Core.Status.Attach(collection =>
            {
                if (QueueServerListeners?.Any() != true)
                {
                    return;
                }
                foreach (var listener in QueueServerListeners)
                {
                    Core.Status.AttachChild(listener, this);
                }
            });
        }
Esempio n. 2
0
 protected MQueueServerBase()
 {
     Counters = new MQServerCounters();
     Core.Status.Attach(collection =>
     {
         collection.Add("Type", GetType().FullName);
     });
 }
 protected MQueueServerListenerBase(MQConnection connection, IMQueueServer server, bool responseServer)
 {
     Connection         = connection;
     Config             = server.Config;
     Counters           = new MQServerCounters();
     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);
     });
 }