using System; namespace Tapeti.Config { /// /// Provides information about the message currently being handled. /// public interface IMessageContext : IAsyncDisposable, IDisposable { /// /// Provides access to the Tapeti config. /// ITapetiConfig Config { get; } /// /// Contains the name of the queue the message was consumed from. /// string Queue { get; } /// /// Contains the exchange to which the message was published. /// string Exchange { get; } /// /// Contains the routing key as provided when the message was published. /// string RoutingKey { get; } /// /// Contains the decoded message instance. /// object Message { get; } /// /// Provides access to the message metadata. /// IMessageProperties Properties { get; } /// /// Provides access to the binding which is currently processing the message. /// IBinding Binding { get; } /// /// Stores a key-value pair in the context for passing information between the various /// middleware stages (mostly for IControllerMiddlewareBase descendants). /// /// A unique key. It is recommended to prefix it with the package name which hosts the middleware to prevent conflicts /// Will be disposed if the value implements IDisposable or IAsyncDisposable void Store(string key, object value); /// /// Retrieves a previously stored value. /// /// /// /// True if the value was found, False otherwise bool Get(string key, out T value) where T : class; } }