Пример #1
0
        protected override void Dispose(bool disposing)
        {
            // base.Dispose must be called first, because it flushes all pending EmitBatchAsync.
            // Closing the client first would have resulted in an infinite retry loop to flush.
            base.Dispose(disposing);

            try
            {
                // Disposing channel and connection objects is not enough, they must be explicitly closed with the API methods.
                // https://www.rabbitmq.com/dotnet-api-guide.html#disconnecting
                _client.Close();
            }
            catch
            {
                // ignore exceptions
            }

            _client.Dispose();
        }
Пример #2
0
 protected override void Dispose(bool disposing)
 {
     base.Dispose(disposing);
     _client.Dispose();
 }