Пример #1
0
        /// <summary>
        /// Increments the total number of delivery attempts in the basic properties of a message
        /// </summary>
        /// <param name="basicProperties">The basic properties of the message</param>
        public static void IncrementDeliveryAttempts(this IBasicProperties basicProperties)
        {
            var attempts = basicProperties.GetDeliveryAttempts();

            attempts++;
            var headers = basicProperties.Headers;

            if (headers == null)
            {
                headers = new Dictionary <string, object>();
                basicProperties.Headers = headers;
            }
            headers["x-platibus-attempts"] = attempts;
        }