Example #1
0
        public void Init(MQPairConfig config, bool sendOnly)
        {
            if (config is null)
            {
                return;
            }

            Config   = config;
            SendOnly = sendOnly;
            Name     = Config.Name;
            Counters = new MQClientCounters(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();
        }
Example #2
0
 /// <summary>
 /// Message Queue client base
 /// </summary>
 protected MQueueClientBase()
 {
     Counters = new MQClientCounters();
     Core.Status.Attach(collection =>
     {
         collection.Add("Type", GetType().FullName);
     });
 }