Class ConsumerNameFilterAttribute
- Namespace
- Silverback.Messaging.Subscribers
- Assembly
- Silverback.Integration.dll
Can be placed on a subscribed method to filter the messages to be processed according to the name of the consumer that consumed them. This is useful when having multiple consumers subscribed to the same topic.
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
public sealed class ConsumerNameFilterAttribute : MessageFilterAttribute, IMessageFilter
- Inheritance
-
ConsumerNameFilterAttribute
- Implements
- Inherited Members
Constructors
ConsumerNameFilterAttribute(params string[])
Initializes a new instance of the ConsumerNameFilterAttribute class.
public ConsumerNameFilterAttribute(params string[] groupId)
Parameters
groupIdstring[]The list of group id whose messages have to be processed.
Properties
GroupId
Gets the names of the consumers whose messages have to be processed.
public string[] GroupId { get; }
Property Value
- string[]
Methods
MustProcess(object)
Returns a boolean value indicating whether the specified message must be processed by the subscribed method decorated with this attribute.
public override bool MustProcess(object message)
Parameters
messageobjectThe message to be checked.
Returns
- bool
A boolean value indicating whether the message must be processed by the subscribed method.