Class ConsumerNameFilterAttribute
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.
Implements
Inherited Members
Namespace: Silverback.Messaging.Subscribers
Assembly: Silverback.Integration.dll
Syntax
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
public sealed class ConsumerNameFilterAttribute : MessageFilterAttribute, IMessageFilter
Constructors
ConsumerNameFilterAttribute(params string[])
Initializes a new instance of the ConsumerNameFilterAttribute class.
Declaration
public ConsumerNameFilterAttribute(params string[] groupId)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | groupId | 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.
Declaration
public string[] GroupId { get; }
Property Value
| Type | Description |
|---|---|
| string[] |
Methods
MustProcess(object)
Returns a boolean value indicating whether the specified message must be processed by the subscribed method decorated with this attribute.
Declaration
public override bool MustProcess(object message)
Parameters
| Type | Name | Description |
|---|---|---|
| object | message | The message to be checked. |
Returns
| Type | Description |
|---|---|
| bool | A boolean value indicating whether the message must be processed by the subscribed method. |