Beispiel #1
0
        public void MultiAckMessage()
        {
            try
            {
                AmqpClient.BasicAck(message.DeliveryTag, true);

                var payload = System.Text.Encoding.UTF8.GetString(message.Body);
                AmqpConsole.Color = new Color(1f, 0.5f, 0);
                AmqpClient.Log("This message (and all previous unacknowledged ones) were acknowledged: " + payload);
                AmqpConsole.Color = null;
            }
            catch (Exception ex)
            {
                AmqpConsole.Color = new Color(1f, 0.5f, 0);
                AmqpClient.Log("ERROR: " + ex.Message);
                AmqpConsole.Color = null;
            }
            Background.color = new Color32(45, 210, 39, 81);
        }
Beispiel #2
0
        public void BasicAck()
        {
            if (queueMessages.Count > 0)
            {
                var msg = queueMessages.Dequeue();

                try
                {
                    AmqpClient.BasicAck(msg.DeliveryTag, false);

                    var payload = System.Text.Encoding.UTF8.GetString(msg.Body);
                    AmqpConsole.Color = new Color(1f, 0.5f, 0);
                    AmqpClient.Log("Message acknowledged: " + payload);
                    AmqpConsole.Color = null;
                }
                catch (Exception ex)
                {
                    AmqpConsole.Color = new Color(1f, 0.5f, 0);
                    AmqpClient.Log("ERROR: " + ex.Message);
                    AmqpConsole.Color = null;
                }
            }
        }