public void Dispose() { if (messageQueue != null) { messageQueue.Dispose(); messageQueue = null; } }
public MessageQueueReader(MqQueueConnectionInfo options, ILogger <MessageQueueReader> logger, ILoggerFactory loggerFactory) { this.options = options; this.logger = logger; if (this.options?.CodePage > 0) { this.Encoding = Encoding.GetEncoding(this.options.CodePage.Value); } MqReaderEndPoints ooo = new MqReaderEndPoints(); ooo.PeekMode = this.options.Operation == QueueOperationTypes.Peek; ooo.EndPoints = new System.Collections.Generic.Dictionary <string, MqEndPoint>(); foreach (var o in this.options.Queues) { ooo.EndPoints.Add(o.Key, o.Value); } this.messageQueue = new MqReader(ooo, loggerFactory); //this.Connect(); }