Class KafkaGroupIdFilterAttribute
Can be placed on a subscribed method to filter the messages to be processed according to the group id that consumed them. This is used when having multiple consumer groups for the same topic running in the same process.
Implements
Inherited Members
Namespace: Silverback.Messaging.Subscribers
Assembly: Silverback.Integration.Kafka.dll
Syntax
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
public sealed class KafkaGroupIdFilterAttribute : MessageFilterAttribute, IMessageFilter
Constructors
KafkaGroupIdFilterAttribute(params string[])
Initializes a new instance of the KafkaGroupIdFilterAttribute class.
Declaration
public KafkaGroupIdFilterAttribute(params string[] groupId)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | groupId | The list of group id whose messages have to be processed. |
Properties
GroupId
Gets the list of group id 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. |