/// <summary>
        /// Adds a handling rule based on the supplied message specification and
        /// action delegate
        /// </summary>
        /// <typeparam name="TContent">The type of deserialized message
        /// content expected</typeparam>
        /// <param name="configuration">The configuration object to which the
        /// handling rule is being added</param>
        /// <param name="specification">The message specification used to match
        /// messages for the handler</param>
        /// <param name="handleContent">An action delegate that will be used to
        /// handle messages</param>
        /// <param name="queueName">(Optional) The name of the queue to which
        /// the handler will be attached</param>
        /// <param name="queueOptions">(Optional) Options for how queued messages for the handler
        /// should be processed</param>
        public static void AddHandlingRule <TContent>(this PlatibusConfiguration configuration,
                                                      IMessageSpecification specification, Action <TContent, IMessageContext> handleContent,
                                                      QueueName queueName = null, QueueOptions queueOptions = null)
        {
            var messageHandler = DelegateMessageHandler.For(handleContent);
            var handlingRule   = new HandlingRule(specification, messageHandler, queueName, queueOptions);

            configuration.AddHandlingRule(handlingRule);
        }
        /// <summary>
        /// Adds a handling rule based on the a name pattern and function delegate
        /// </summary>
        /// <typeparam name="TContent">The type of deserialized message
        /// content expected</typeparam>
        /// <param name="configuration">The configuration object to which the
        /// handling rule is being added</param>
        /// <param name="namePattern">A regular expression used to match message
        /// names for the handler</param>
        /// <param name="handleContent">A function delegate that will be used to
        /// handle messages</param>
        /// <param name="queueName">(Optional) The name of the queue to which
        /// the handler will be attached</param>
        /// <param name="queueOptions">(Optional) Options for how queued messages for the handler
        /// should be processed</param>
        public static void AddHandlingRule <TContent>(this PlatibusConfiguration configuration, string namePattern,
                                                      Func <TContent, IMessageContext, CancellationToken, Task> handleContent,
                                                      QueueName queueName = null, QueueOptions queueOptions = null)
        {
            var specification  = new MessageNamePatternSpecification(namePattern);
            var messageHandler = DelegateMessageHandler.For(handleContent);
            var handlingRule   = new HandlingRule(specification, messageHandler, queueName, queueOptions);

            configuration.AddHandlingRule(handlingRule);
        }