Ejemplo n.º 1
0
 protected virtual void Dispose(bool disposing)
 {
     lock (syncObj) {
         if (!isDisposed && disposing)
         {
             delegateTx.Dispose();
         }
     }
 }
        /// <summary>
        /// Dispose locale objects
        /// </summary>
        /// <param name="disposing">Disposing</param>
        protected virtual void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                if (disposing)
                {
                    _messageQueueTransaction?.Dispose();
                }

                _disposed = true;
            }
        }
Ejemplo n.º 3
0
        private ITransactionalMessage CreateTransactionalMessage(Stream stream, IMessageQueueTransaction messageQueueTransaction)
        {
            stream.Position = 0;

            using (var streamReader = new StreamReader(stream, Encoding.UTF8))
            {
                var queueMessage = streamReader.ReadToEnd().DeserializeFromJson <QueueMessage>();

                if (queueMessage != null)
                {
                    Logger.Debug("Message received {QueueName} {Type} {%Message}", Name, queueMessage?.MessageType?.FullName, queueMessage?.MessageBody);
                }

                if (queueMessage == null)
                {
                    messageQueueTransaction?.Commit();
                    messageQueueTransaction?.Dispose();
                    messageQueueTransaction = null;
                }

                return(new TransactionalMessage(queueMessage, messageQueueTransaction));
            }
        }
Ejemplo n.º 4
0
 public void Dispose()
 {
     _serviceScope?.Dispose();
     _messageQueueTransaction?.Dispose();
 }