using System; // ReSharper disable UnusedMember.Global namespace Tapeti.Config { /// /// Configures Tapeti. Every method other than Build returns the builder instance /// for method chaining. /// public interface ITapetiConfigBuilder { /// /// Returns a locked version of the configuration which can be used to establish a connection. /// ITapetiConfig Build(); /// /// Registers binding middleware which is called when a binding is created for a controller method. /// /// ITapetiConfigBuilder Use(IControllerBindingMiddleware handler); /// /// Registers message middleware which is called to handle an incoming message. /// /// ITapetiConfigBuilder Use(IMessageMiddleware handler); /// /// Registers publish middleware which is called when a message is published. /// /// ITapetiConfigBuilder Use(IPublishMiddleware handler); /// /// Registers a Tapeti extension, which is a bundling mechanism for features that require more than one middleware and /// optionally other dependency injected implementations. /// /// ITapetiConfigBuilder Use(ITapetiExtension extension); /// /// Registers a binding which can accept messages. In most cases this method should not be called outside /// of Tapeti. Instead use the RegisterAllControllers extension method to automatically create bindings. /// /// void RegisterBinding(IBinding binding); /// /// Disables 'publisher confirms'. 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. /// /// WARNING: disabling publisher confirms means there is no guarantee that a Publish succeeds, /// and disables Tapeti.Flow from verifying if a request/response can be routed. This may /// result in never-ending flows. Only disable if you can accept those consequences. /// ITapetiConfigBuilder DisablePublisherConfirms(); /// /// Configures 'publisher confirms'. 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. /// /// WARNING: disabling publisher confirms means there is no guarantee that a Publish succeeds, /// and disables Tapeti.Flow from verifying if a request/response can be routed. This may /// result in never-ending flows. Only disable if you can accept those consequences. /// ITapetiConfigBuilder SetPublisherConfirms(bool enabled); /// /// Enables the automatic creation of durable queues and updating of their bindings. /// /// /// Note that access to the RabbitMQ Management plugin's REST API is required for this /// feature to work, since AMQP does not provide a way to query existing bindings. /// ITapetiConfigBuilder EnableDeclareDurableQueues(); /// /// Configures the automatic creation of durable queues and updating of their bindings. /// /// /// Note that access to the RabbitMQ Management plugin's REST API is required for this /// feature to work, since AMQP does not provide a way to query existing bindings. /// ITapetiConfigBuilder SetDeclareDurableQueues(bool enabled); } /// /// Access interface for ITapetiConfigBuilder extension methods. Allows access to the registered middleware /// before the configuration is built. Implementations of ITapetiConfigBuilder should also implement this interface. /// Should not be used outside of Tapeti packages. /// public interface ITapetiConfigBuilderAccess { /// /// Provides access to the dependency resolver. /// IDependencyResolver DependencyResolver { get; } /// /// Applies the currently registered binding middleware to the specified context. /// /// /// void ApplyBindingMiddleware(IControllerBindingContext context, Action lastHandler); } }