Example #1
0
        public static string AsString(this RabbitMQDelivery message)
        {
            var encodingName = message.source.BasicProperties.ContentEncoding;

            var encoding = encodingName != null
                ? Encoding.GetEncoding(encodingName)
                : Encoding.UTF8
            ;

            return(AsString(message, encoding));
        }
Example #2
0
        public static string AsString(this RabbitMQDelivery message, Encoding encoding)
        {
            var body = message.source.Body;

            if (body == null)
            {
                return(null);
            }

            return(encoding.GetString(body));
        }