Beispiel #1
0
        protected override void OnClose()
        {
            active = false;

            if (amqpTransport != null)
            {
                amqpTransport.Close();
                amqpTransport = null;
            }

            if (loggingBuffer != null)
            {
                loggingBuffer.Dispose();
            }

            if (messagePump != null && messagePump.IsAlive)
            {
                messagePump.Abort();
                messagePump.Join(5000);
            }

            messagePump   = null;
            loggingBuffer = null;

            base.OnClose();
        }
Beispiel #2
0
        /// <summary>
        /// Sending the message via AMQP
        /// </summary>
        /// <param name="message">Message to be sent</param>
        private void SendAmqpMessage(string message)
        {
            if (amqpTransport == null)
            {
                amqpTransport = new AmqpTransport()
                {
                    IpAddress   = GetIpAddressFromHostName(),
                    Port        = AmqpServerPort,
                    VirtualHost = AmqpVirtualHost,
                    User        = AmqpUser,
                    Password    = AmqpPassword,
                    Queue       = AmqpQueue
                };
            }

            amqpTransport.Send(message);
        }
        protected override void OnClose()
        {
            if (amqpTransport != null)
            {
                amqpTransport.Close();
                amqpTransport = null;
            }

            messagePump.Abort();
            messagePump.Join(5000);

            messagePump = null;

            base.OnClose();
        }
        /// <summary>
        /// Sending the message via AMQP
        /// </summary>
        /// <param name="message">Message to be sent</param>
        private void SendAmqpMessage(string message)
        {
            if (amqpTransport == null)
            {
                amqpTransport = new AmqpTransport()
                {
                    IpAddress = GetIpAddressFromHostName(),
                    Port = AmqpServerPort,
                    VirtualHost = AmqpVirtualHost,
                    User = AmqpUser,
                    Password = AmqpPassword,
                    Queue = AmqpQueue
                };
            }

            amqpTransport.Send(message);
        }
        protected override void OnClose()
        {
            active = false;

            if (amqpTransport != null)
            {
                amqpTransport.Close();
                amqpTransport = null;
            }

            if (loggingBuffer != null)
            {
                loggingBuffer.Dispose();
            }

            if (messagePump != null && messagePump.IsAlive)
            {
                messagePump.Abort();
                messagePump.Join(5000);
            }

            messagePump = null;
            loggingBuffer = null;

            base.OnClose();
        }