diff --git a/Annotations/DynamicQueueAttribute.cs b/Annotations/DynamicQueueAttribute.cs
new file mode 100644
index 0000000..3d730c9
--- /dev/null
+++ b/Annotations/DynamicQueueAttribute.cs
@@ -0,0 +1,13 @@
+using System;
+
+namespace Tapeti.Annotations
+{
+ ///
+ /// Creates a non-durable auto-delete queue to receive messages. Can be used
+ /// on an entire MessageController class or on individual methods.
+ ///
+ [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
+ public class DynamicQueueAttribute : Attribute
+ {
+ }
+}
diff --git a/Annotations/MessageControllerAttribute.cs b/Annotations/MessageControllerAttribute.cs
new file mode 100644
index 0000000..1f419f2
--- /dev/null
+++ b/Annotations/MessageControllerAttribute.cs
@@ -0,0 +1,9 @@
+using System;
+
+namespace Tapeti.Annotations
+{
+ [AttributeUsage(AttributeTargets.Class)]
+ public class MessageControllerAttribute : Attribute
+ {
+ }
+}
diff --git a/Annotations/QueueAttribute.cs b/Annotations/QueueAttribute.cs
deleted file mode 100644
index 878390d..0000000
--- a/Annotations/QueueAttribute.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using System;
-
-namespace Tapeti.Annotations
-{
- [AttributeUsage(AttributeTargets.Class)]
- public class QueueAttribute : Attribute
- {
- public string Name { get; set; }
- public bool Dynamic { get; set; }
-
-
- public QueueAttribute(string name = null)
- {
- Name = name;
- Dynamic = (name == null);
- }
- }
-}
diff --git a/Annotations/StaticQueueAttribute.cs b/Annotations/StaticQueueAttribute.cs
new file mode 100644
index 0000000..2a9c6b1
--- /dev/null
+++ b/Annotations/StaticQueueAttribute.cs
@@ -0,0 +1,25 @@
+using System;
+
+namespace Tapeti.Annotations
+{
+ ///
+ /// Binds to an existing durable queue to receive messages. Can be used
+ /// on an entire MessageController class or on individual methods.
+ ///
+ ///
+ /// At the moment there is no support for creating a durable queue and managing the
+ /// bindings. The author recommends https://git.x2software.net/pub/RabbitMetaQueue
+ /// for deploy-time management of durable queues (shameless plug intended).
+ ///
+ [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
+ public class StaticQueueAttribute : Attribute
+ {
+ public string Name { get; set; }
+
+
+ public StaticQueueAttribute(string name)
+ {
+ Name = name;
+ }
+ }
+}
diff --git a/Config/IBindingContext.cs b/Config/IBindingContext.cs
new file mode 100644
index 0000000..df3444e
--- /dev/null
+++ b/Config/IBindingContext.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+
+namespace Tapeti.Config
+{
+ public delegate object ValueFactory(IMessageContext context);
+
+
+ public interface IBindingContext
+ {
+ Type MessageClass { get; set; }
+ IReadOnlyList Parameters { get; }
+ }
+
+
+ public interface IBindingParameter
+ {
+ ParameterInfo Info { get; }
+ bool HasBinding { get; }
+
+ void SetBinding(ValueFactory valueFactory);
+ }
+}
diff --git a/Config/IBindingMiddleware.cs b/Config/IBindingMiddleware.cs
new file mode 100644
index 0000000..e2d977c
--- /dev/null
+++ b/Config/IBindingMiddleware.cs
@@ -0,0 +1,9 @@
+using System;
+
+namespace Tapeti.Config
+{
+ public interface IBindingMiddleware
+ {
+ void Handle(IBindingContext context, Action next);
+ }
+}
diff --git a/Config/IConfig.cs b/Config/IConfig.cs
new file mode 100644
index 0000000..8752c97
--- /dev/null
+++ b/Config/IConfig.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Threading.Tasks;
+
+namespace Tapeti.Config
+{
+ public interface IConfig
+ {
+ string Exchange { get; }
+ IDependencyResolver DependencyResolver { get; }
+ IReadOnlyList MessageMiddleware { get; }
+ IEnumerable Queues { get; }
+ }
+
+
+ public interface IQueue
+ {
+ bool Dynamic { get; }
+ string Name { get; }
+
+ IEnumerable Bindings { get; }
+ }
+
+
+ public interface IBinding
+ {
+ Type Controller { get; }
+ MethodInfo Method { get; }
+ Type MessageClass { get; }
+
+ bool Accept(object message);
+ Task