Ejemplo n.º 1
0
        public void Init(MQPairConfig config, bool sendOnly)
        {
            if (config is null)
            {
                return;
            }

            Config   = config;
            Name     = Config.Name;
            SendOnly = sendOnly;
            Counters = new MQRawClientCounters(Name, Config.IgnoreClientCounters);

            SenderSerializer = SerializerManager.GetByMimeType(Config.RequestOptions?.SerializerMimeType);
            if (SenderSerializer != null && Config.RequestOptions?.CompressorEncodingType.IsNotNullOrEmpty() == true)
            {
                SenderSerializer.Compressor = CompressorManager.GetByEncodingType(Config.RequestOptions?.CompressorEncodingType);
            }
            ReceiverSerializer = SerializerManager.GetByMimeType(Config.ResponseOptions?.SerializerMimeType);
            if (ReceiverSerializer != null && Config.ResponseOptions?.CompressorEncodingType.IsNotNullOrEmpty() == true)
            {
                ReceiverSerializer.Compressor = CompressorManager.GetByEncodingType(Config.ResponseOptions?.CompressorEncodingType);
            }

            OnInit();
        }
Ejemplo n.º 2
0
 protected MQueueRawClientBase()
 {
     Counters = new MQRawClientCounters();
     Core.Status.Attach(collection =>
     {
         collection.Add("Type", GetType().FullName);
     });
 }