Table of Contents

Class MqttClientIdFilterAttribute

Namespace
Silverback.Messaging.Subscribers
Assembly
Silverback.Integration.MQTT.dll

Can be placed on a subscribed method to filter the messages to be processed according to the client id that consumed them. This is used when having multiple clients for the same topic running in the same process.

[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
public sealed class MqttClientIdFilterAttribute : MessageFilterAttribute, IMessageFilter
Inheritance
MqttClientIdFilterAttribute
Implements
Inherited Members

Constructors

MqttClientIdFilterAttribute(params string[])

Initializes a new instance of the MqttClientIdFilterAttribute class.

public MqttClientIdFilterAttribute(params string[] clientId)

Parameters

clientId string[]

The list of client id whose messages have to be processed.

Properties

ClientId

Gets the list of client id whose messages have to be processed.

public string[] ClientId { 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.