using System;
using System.Collections.Generic;
namespace Tapeti.Config
{
///
/// Provides access to the Tapeti configuration.
///
public interface ITapetiConfig
{
///
/// Reference to the wrapper for an IoC container, to provide dependency injection to Tapeti.
///
IDependencyResolver DependencyResolver { get; }
///
/// Various Tapeti features which can be turned on or off.
///
ITapetiConfigFeatues Features { get; }
///
/// Provides access to the different kinds of registered middleware.
///
ITapetiConfigMiddleware Middleware { get; }
///
/// A list of all registered bindings.
///
ITapetiConfigBindings Bindings { get; }
}
///
/// Various Tapeti features which can be turned on or off.
///
public interface ITapetiConfigFeatues
{
///
/// Determines whether 'publisher confirms' are used. This RabbitMQ features allows Tapeti to
/// be notified if a message has no route, and guarantees delivery for request-response style
/// messages and those marked with the Mandatory attribute. On by default, can only be turned
/// off by explicitly calling DisablePublisherConfirms, which is not recommended.
///
bool PublisherConfirms { get; }
///
/// If enabled, durable queues will be created at startup and their bindings will be updated
/// with the currently registered message handlers. If not enabled all durable queues must
/// already be present when the connection is made.
///
bool DeclareDurableQueues { get; }
}
///
/// Provides access to the different kinds of registered middleware.
///
public interface ITapetiConfigMiddleware
{
///
/// A list of message middleware which is called when a message is being consumed.
///
IReadOnlyList Message { get; }
///
/// A list of publish middleware which is called when a message is being published.
///
IReadOnlyList Publish { get; }
}
///
///
/// Contains a list of registered bindings, with a few added helpers.
///
public interface ITapetiConfigBindings : IReadOnlyList
{
///
/// Searches for a binding linked to the specified method.
///
///
/// The binding if found, null otherwise
IControllerMethodBinding ForMethod(Delegate method);
}
/*
public interface IBinding
{
Type Controller { get; }
MethodInfo Method { get; }
Type MessageClass { get; }
string QueueName { get; }
QueueBindingMode QueueBindingMode { get; set; }
IReadOnlyList MessageFilterMiddleware { get; }
IReadOnlyList MessageMiddleware { get; }
bool Accept(Type messageClass);
bool Accept(IMessageContext context, object message);
Task Invoke(IMessageContext context, object message);
}
*/
/*
public interface IBuildBinding : IBinding
{
void SetQueueName(string queueName);
}
*/
}