Table of Contents

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

envelope IOutboundEnvelope

The envelope containing the message.

Returns

int?

The destination partition.

GetKafkaDestinationTopic(IOutboundEnvelope)

Gets the destination topic.

public static string? GetKafkaDestinationTopic(this IOutboundEnvelope envelope)

Parameters

envelope IOutboundEnvelope

The 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

envelope IBrokerEnvelope

The 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

envelope IRawInboundEnvelope

The 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

envelope IRawInboundEnvelope

The 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

envelope IOutboundEnvelope

The envelope containing the message.

destinationPartition int

The 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

envelope IOutboundEnvelope

The envelope containing the message.

destinationTopic string

The destination topic.

destinationPartition int?

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

envelope IOutboundEnvelope

The envelope containing the message.

key string

The Kafka message key.

Returns

IOutboundEnvelope

The IOutboundEnvelope so that additional calls can be chained.