Class KafkaEnvelopeExtensions
Adds some convenience extension methods to the envelope interfaces.
Inherited Members
Namespace: Silverback.Messaging.Messages
Assembly: Silverback.Integration.Kafka.dll
Syntax
public static class KafkaEnvelopeExtensions
Methods
GetKafkaDestinationPartition(IOutboundEnvelope)
Gets destination partition.
Declaration
public static int? GetKafkaDestinationPartition(this IOutboundEnvelope envelope)
Parameters
| Type | Name | Description |
|---|---|---|
| IOutboundEnvelope | envelope | The envelope containing the message. |
Returns
| Type | Description |
|---|---|
| int? | The destination partition. |
GetKafkaDestinationTopic(IOutboundEnvelope)
Gets the destination topic.
Declaration
public static string? GetKafkaDestinationTopic(this IOutboundEnvelope envelope)
Parameters
| Type | Name | Description |
|---|---|---|
| IOutboundEnvelope | envelope | The envelope containing the message. |
Returns
| Type | Description |
|---|---|
| string | The destination topic. |
GetKafkaKey(IBrokerEnvelope)
Gets the key of the message consumed from Kafka.
Declaration
public static string? GetKafkaKey(this IBrokerEnvelope envelope)
Parameters
| Type | Name | Description |
|---|---|---|
| IBrokerEnvelope | envelope | The envelope containing the message. |
Returns
| Type | Description |
|---|---|
| string | The Kafka message key. |
GetKafkaOffset(IRawInboundEnvelope)
Gets the offset of the message consumed from Kafka.
Declaration
public static KafkaOffset GetKafkaOffset(this IRawInboundEnvelope envelope)
Parameters
| Type | Name | Description |
|---|---|---|
| IRawInboundEnvelope | envelope | The envelope containing the message. |
Returns
| Type | Description |
|---|---|
| KafkaOffset | The offset of the message. |
GetKafkaTimestamp(IRawInboundEnvelope)
Gets the timestamp of the message consumed from Kafka.
Declaration
public static DateTime? GetKafkaTimestamp(this IRawInboundEnvelope envelope)
Parameters
| Type | Name | Description |
|---|---|---|
| IRawInboundEnvelope | envelope | The envelope containing the message. |
Returns
| Type | Description |
|---|---|
| DateTime? | The timestamp of the message. |
SetKafkaDestinationPartition(IOutboundEnvelope, int)
Sets the destination partition.
Declaration
public static IOutboundEnvelope SetKafkaDestinationPartition(this IOutboundEnvelope envelope, int destinationPartition)
Parameters
| Type | Name | Description |
|---|---|---|
| IOutboundEnvelope | envelope | The envelope containing the message. |
| int | destinationPartition | The destination partition. |
Returns
| Type | Description |
|---|---|
| IOutboundEnvelope | The IOutboundEnvelope so that additional calls can be chained. |
SetKafkaDestinationTopic(IOutboundEnvelope, string, int?)
Sets the destination topic.
Declaration
public static IOutboundEnvelope SetKafkaDestinationTopic(this IOutboundEnvelope envelope, string destinationTopic, int? destinationPartition = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IOutboundEnvelope | envelope | The envelope containing the message. |
| string | destinationTopic | The destination topic. |
| int? | destinationPartition | The destination partition. |
Returns
| Type | Description |
|---|---|
| IOutboundEnvelope | The IOutboundEnvelope so that additional calls can be chained. |
SetKafkaKey(IOutboundEnvelope, string)
Sets the key of the message to be produced to Kafka.
Declaration
public static IOutboundEnvelope SetKafkaKey(this IOutboundEnvelope envelope, string key)
Parameters
| Type | Name | Description |
|---|---|---|
| IOutboundEnvelope | envelope | The envelope containing the message. |
| string | key | The Kafka message key. |
Returns
| Type | Description |
|---|---|
| IOutboundEnvelope | The IOutboundEnvelope so that additional calls can be chained. |