private async Task _OnMessageReceived(object model, BasicDeliverEventArgs ea)
        {
            Log.Debug("Picked up message {DeliveryTag}.", ea.DeliveryTag);

            var message = MessageSerialization.CreateFrom(ea);

            var priority = _GetMessagePriority(message);

            QueuePublisher.EnqueueJsonMessage(message, priority: priority);

            ConsumerChannel.Model.BasicAck(deliveryTag: ea.DeliveryTag, multiple: false);

            Log.Debug("Finished message {DeliveryTag}", ea.DeliveryTag);
            await Task.CompletedTask;
        }
        private async Task _OnMessageReceived(object sender, BasicDeliverEventArgs ea)
        {
            Log.Debug("Picked up message (priority: {Priority}), tag: {DeliveryTag}.", ea.BasicProperties.Priority, ea.DeliveryTag);

            var message = MessageSerialization.CreateFrom(ea);

            Log.Information("{body}", message);

            var json = JsonFormatter.Default.Format(message);
            var body = Encoding.UTF8.GetBytes(json);

            var hubMessage = new Message(body);
            await ModuleClient.SendEventAsync(hubMessage);

            // Slow down for the console output to be understandable
            await Task.Delay(TimeSpan.FromMilliseconds(50));

            Channel.Model.BasicAck(deliveryTag: ea.DeliveryTag, multiple: false);

            Log.Debug("Finished message {DeliveryTag}", ea.DeliveryTag);
        }