Fix for #24: Queue attribute is required for Start methods
This commit is contained in:
parent
13833040e8
commit
b150e30f2b
@ -47,15 +47,8 @@ namespace Tapeti
|
||||
.Where(m => m.MemberType == MemberTypes.Method && m.DeclaringType != typeof(object) && (m as MethodInfo)?.IsSpecialName == false)
|
||||
.Select(m => (MethodInfo)m))
|
||||
{
|
||||
var methodQueueInfo = GetQueueInfo(method) ?? controllerQueueInfo;
|
||||
if (methodQueueInfo == null || !methodQueueInfo.IsValid)
|
||||
throw new TopologyConfigurationException(
|
||||
$"Method {method.Name} or controller {controller.Name} requires a queue attribute");
|
||||
|
||||
|
||||
var methodIsObsolete = controllerIsObsolete || method.GetCustomAttribute<ObsoleteAttribute>() != null;
|
||||
|
||||
|
||||
var context = new ControllerBindingContext(method.GetParameters(), method.ReturnParameter)
|
||||
{
|
||||
Controller = controller,
|
||||
@ -85,6 +78,10 @@ namespace Tapeti
|
||||
throw new TopologyConfigurationException($"Method {method.Name} in controller {method.DeclaringType?.Name} has unknown parameters: {parameterNames}");
|
||||
}
|
||||
|
||||
var methodQueueInfo = GetQueueInfo(method) ?? controllerQueueInfo;
|
||||
if (methodQueueInfo == null || !methodQueueInfo.IsValid)
|
||||
throw new TopologyConfigurationException(
|
||||
$"Method {method.Name} or controller {controller.Name} requires a queue attribute");
|
||||
|
||||
builder.RegisterBinding(new ControllerMethodBinding(builderAccess.DependencyResolver, new ControllerMethodBinding.BindingInfo
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user