Table of Contents

Interface IOutboundEnvelope

Namespace
Silverback.Messaging.Messages
Assembly
Silverback.Integration.dll

Wraps the message that is being produced to an outbound endpoint.

public interface IOutboundEnvelope : IBrokerEnvelope, IRawBrokerEnvelope, IEnvelope
Inherited Members

Properties

BrokerMessageIdentifier

Gets the message identifier on the message broker (the Kafka offset or similar).

IBrokerMessageIdentifier? BrokerMessageIdentifier { get; }

Property Value

IBrokerMessageIdentifier

Remarks

The identifier value will be set only after the message has been successfully published to the message broker.

Context

Gets the current ISilverbackContext.

ISilverbackContext? Context { get; }

Property Value

ISilverbackContext

EndpointConfiguration

Gets the destination endpoint configuration.

ProducerEndpointConfiguration EndpointConfiguration { get; }

Property Value

ProducerEndpointConfiguration

Producer

Gets the IProducer that will be or was used to produce this message.

IProducer Producer { get; }

Property Value

IProducer

Methods

AddHeader(string, object)

Adds a new header.

IOutboundEnvelope AddHeader(string name, object value)

Parameters

name string

The header name.

value object

The header value.

Returns

IOutboundEnvelope

The IOutboundEnvelope so that additional calls can be chained.

AddHeaderIfNotExists(string, object?)

Adds a new header if no header with the same name is already set.

IOutboundEnvelope AddHeaderIfNotExists(string name, object? newValue)

Parameters

name string

The header name.

newValue object

The new header value.

Returns

IOutboundEnvelope

The IOutboundEnvelope so that additional calls can be chained.

AddOrReplaceHeader(string, object?)

Adds a new header or replaces the header with the same name.

IOutboundEnvelope AddOrReplaceHeader(string name, object? newValue)

Parameters

name string

The header name.

newValue object

The new header value.

Returns

IOutboundEnvelope

The IOutboundEnvelope so that additional calls can be chained.

CloneReplacingMessage<TNewMessage>(TNewMessage)

Clones the envelope and replaces the contained message with the specified one.

IOutboundEnvelope<TNewMessage> CloneReplacingMessage<TNewMessage>(TNewMessage newMessage) where TNewMessage : class

Parameters

newMessage TNewMessage

The new message to be set.

Returns

IOutboundEnvelope<TNewMessage>

The new envelope.

Type Parameters

TNewMessage

The type of the new message.

Remarks

The raw message will be cleared.

CloneReplacingRawMessage(Stream?)

Clones the envelope and replaces the raw message with the specified one.

IOutboundEnvelope CloneReplacingRawMessage(Stream? newRawMessage)

Parameters

newRawMessage Stream

The new raw message to be set.

Returns

IOutboundEnvelope

The new envelope.

GetEndpoint()

Gets the destination endpoint for the specific message.

ProducerEndpoint GetEndpoint()

Returns

ProducerEndpoint

The endpoint.