Class InboundEnvelopeBuilderExtensions
- Namespace
- Silverback.Messaging.Messages
- Assembly
- Silverback.Integration.Kafka.Testing.dll
Adds the Kafka specific methods to the InboundEnvelopeBuilder<TMessage>.
public static class InboundEnvelopeBuilderExtensions
- Inheritance
-
InboundEnvelopeBuilderExtensions
- Inherited Members
Methods
WithKafkaKey<TMessage>(InboundEnvelopeBuilder<TMessage>, string)
Sets the key of the message consumed from Kafka.
public static InboundEnvelopeBuilder<TMessage> WithKafkaKey<TMessage>(this InboundEnvelopeBuilder<TMessage> builder, string key) where TMessage : class
Parameters
builderInboundEnvelopeBuilder<TMessage>keystringThe Kafka message key.
Returns
- InboundEnvelopeBuilder<TMessage>
The InboundEnvelopeBuilder<TMessage> so that additional calls can be chained.
Type Parameters
TMessageThe type of the message.
WithKafkaOffset<TMessage>(InboundEnvelopeBuilder<TMessage>, KafkaOffset)
Sets the offset of the message.
public static InboundEnvelopeBuilder<TMessage> WithKafkaOffset<TMessage>(this InboundEnvelopeBuilder<TMessage> builder, KafkaOffset offset) where TMessage : class
Parameters
builderInboundEnvelopeBuilder<TMessage>offsetKafkaOffsetThe offset.
Returns
- InboundEnvelopeBuilder<TMessage>
The InboundEnvelopeBuilder<TMessage> so that additional calls can be chained.
Type Parameters
TMessageThe type of the message.
WithKafkaOffset<TMessage>(InboundEnvelopeBuilder<TMessage>, string, int, long)
Sets the offset of the message.
public static InboundEnvelopeBuilder<TMessage> WithKafkaOffset<TMessage>(this InboundEnvelopeBuilder<TMessage> builder, string topic, int partition, long offset) where TMessage : class
Parameters
builderInboundEnvelopeBuilder<TMessage>topicstringThe topic.
partitionintThe partition.
offsetlongThe offset.
Returns
- InboundEnvelopeBuilder<TMessage>
The InboundEnvelopeBuilder<TMessage> so that additional calls can be chained.
Type Parameters
TMessageThe type of the message.
WithKafkaTimestamp<TMessage>(InboundEnvelopeBuilder<TMessage>, DateTime)
Sets the timestamp of the message consumed from Kafka.
public static InboundEnvelopeBuilder<TMessage> WithKafkaTimestamp<TMessage>(this InboundEnvelopeBuilder<TMessage> builder, DateTime timestamp) where TMessage : class
Parameters
builderInboundEnvelopeBuilder<TMessage>timestampDateTimeThe timestamp of the message.
Returns
- InboundEnvelopeBuilder<TMessage>
The InboundEnvelopeBuilder<TMessage> so that additional calls can be chained.
Type Parameters
TMessageThe type of the message.
WithKafkaTopic<TMessage>(InboundEnvelopeBuilder<TMessage>, string, int)
Sets the topic and, optionally, the partition from which the message was consumed.
public static InboundEnvelopeBuilder<TMessage> WithKafkaTopic<TMessage>(this InboundEnvelopeBuilder<TMessage> builder, string topic, int partition = 0) where TMessage : class
Parameters
builderInboundEnvelopeBuilder<TMessage>topicstringThe topic.
partitionintThe partition index. Set to 0 if not specified.
Returns
- InboundEnvelopeBuilder<TMessage>
The InboundEnvelopeBuilder<TMessage> so that additional calls can be chained.
Type Parameters
TMessageThe type of the message.
WithMqttCorrelationData<TMessage>(InboundEnvelopeBuilder<TMessage>, byte[])
Sets the correlation data.
public static InboundEnvelopeBuilder<TMessage> WithMqttCorrelationData<TMessage>(this InboundEnvelopeBuilder<TMessage> builder, byte[] correlationData) where TMessage : class
Parameters
builderInboundEnvelopeBuilder<TMessage>correlationDatabyte[]The correlation data.
Returns
- InboundEnvelopeBuilder<TMessage>
The InboundEnvelopeBuilder<TMessage> so that additional calls can be chained.
Type Parameters
TMessageThe type of the message.
WithMqttTopic<TMessage>(InboundEnvelopeBuilder<TMessage>, string)
Sets the topic from which the message was consumed.
public static InboundEnvelopeBuilder<TMessage> WithMqttTopic<TMessage>(this InboundEnvelopeBuilder<TMessage> builder, string topic) where TMessage : class
Parameters
builderInboundEnvelopeBuilder<TMessage>topicstringThe topic name.
Returns
- InboundEnvelopeBuilder<TMessage>
The InboundEnvelopeBuilder<TMessage> so that additional calls can be chained.
Type Parameters
TMessageThe type of the message.