Table of Contents

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

groupId string[]

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

message object

The message to be checked.

Returns

bool

A boolean value indicating whether the message must be processed by the subscribed method.