public static int GetAttemptCount(this BasicDeliverEventArgs message) { message.EnsureMessage(); if (message.BasicProperties.Headers.ContainsKey(AttemptCountHeader)) { return((int)message.BasicProperties.Headers[AttemptCountHeader]); } return(0); }
public static void SetHeader <T>(this BasicDeliverEventArgs message, string key, T value) { message.EnsureMessage(); if (Equals(value, default(T))) { message.BasicProperties.Headers.Remove(key); } else { message.BasicProperties.Headers[key] = value; } }
public static object GetHeader(this BasicDeliverEventArgs message, string key) { message.EnsureMessage(); return(message.BasicProperties.Headers.ContainsKey(key) ? message.BasicProperties.Headers[key] : null); }
public static void SetAttemptCount(this BasicDeliverEventArgs message, int count) { message.EnsureMessage(); message.SetHeader(AttemptCountHeader, count); }