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