Class KafkaMessageKeyInitializerProducerBehavior
Sets the Kafka key with the value from the properties decorated with the KafkaKeyMemberAttribute.
Inherited Members
Namespace: Silverback.Messaging.Producing
Assembly: Silverback.Integration.Kafka.dll
Syntax
public class KafkaMessageKeyInitializerProducerBehavior : IProducerBehavior, IBrokerBehavior, ISorted
Constructors
KafkaMessageKeyInitializerProducerBehavior()
Sets the Kafka key with the value from the properties decorated with the KafkaKeyMemberAttribute.
Declaration
public KafkaMessageKeyInitializerProducerBehavior()
Properties
SortIndex
Gets the sort index.
Declaration
public int SortIndex { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
HandleAsync(ProducerPipelineContext, ProducerBehaviorHandler, CancellationToken)
Process, handles or transforms the message being produced.
Declaration
public ValueTask HandleAsync(ProducerPipelineContext context, ProducerBehaviorHandler next, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| ProducerPipelineContext | context | The context that is passed along the behaviors pipeline. |
| ProducerBehaviorHandler | next | The next behavior in the pipeline. |
| CancellationToken | cancellationToken | The cancellation token that can be used to cancel the operation. |
Returns
| Type | Description |
|---|---|
| ValueTask | A ValueTask representing the asynchronous operation. |