Table of Contents

Class MqttDynamicProducerEndpointResolver<TMessage>

Namespace
Silverback.Messaging.Producing.EndpointResolvers
Assembly
Silverback.Integration.MQTT.dll

Dynamically resolves the target topic for each message being produced.

public sealed record MqttDynamicProducerEndpointResolver<TMessage> : DynamicProducerEndpointResolver<TMessage, MqttProducerEndpoint, MqttProducerEndpointConfiguration>, IDynamicProducerEndpointResolver<MqttProducerEndpoint>, IDynamicProducerEndpointResolver, IProducerEndpointResolver<MqttProducerEndpoint>, IProducerEndpointResolver, IEquatable<DynamicProducerEndpointResolver<TMessage, MqttProducerEndpoint, MqttProducerEndpointConfiguration>>, IEquatable<MqttDynamicProducerEndpointResolver<TMessage>> where TMessage : class

Type Parameters

TMessage

The type of the message being produced.

Inheritance
MqttDynamicProducerEndpointResolver<TMessage>
Implements
Inherited Members

Constructors

MqttDynamicProducerEndpointResolver(Func<IOutboundEnvelope<TMessage>, string>)

Initializes a new instance of the MqttDynamicProducerEndpointResolver<TMessage> class.

public MqttDynamicProducerEndpointResolver(Func<IOutboundEnvelope<TMessage>, string> topicFunction)

Parameters

topicFunction Func<IOutboundEnvelope<TMessage>, string>

The function returning the target topic for the message being produced.

MqttDynamicProducerEndpointResolver(Func<TMessage?, string>)

Initializes a new instance of the MqttDynamicProducerEndpointResolver<TMessage> class.

public MqttDynamicProducerEndpointResolver(Func<TMessage?, string> topicFunction)

Parameters

topicFunction Func<TMessage, string>

The function returning the target topic for the message being produced.

MqttDynamicProducerEndpointResolver(string, Func<IOutboundEnvelope<TMessage>, string[]>)

Initializes a new instance of the MqttDynamicProducerEndpointResolver<TMessage> class.

public MqttDynamicProducerEndpointResolver(string topicFormatString, Func<IOutboundEnvelope<TMessage>, string[]> topicArgumentsFunction)

Parameters

topicFormatString string

The topic format string that will be combined with the arguments returned by the topicArgumentsFunction using a Format(string, params object[]).

topicArgumentsFunction Func<IOutboundEnvelope<TMessage>, string[]>

The function returning the arguments to be used to format the string.

MqttDynamicProducerEndpointResolver(string, Func<TMessage?, string[]>)

Initializes a new instance of the MqttDynamicProducerEndpointResolver<TMessage> class.

public MqttDynamicProducerEndpointResolver(string topicFormatString, Func<TMessage?, string[]> topicArgumentsFunction)

Parameters

topicFormatString string

The topic format string that will be combined with the arguments returned by the topicArgumentsFunction using a Format(string, params object[]).

topicArgumentsFunction Func<TMessage, string[]>

The function returning the arguments to be used to format the string.

Properties

EqualityContract

protected override Type EqualityContract { get; }

Property Value

Type

Methods

DeserializeEndpoint(string, MqttProducerEndpointConfiguration)

Deserializes the endpoint from a string.

protected override MqttProducerEndpoint DeserializeEndpoint(string serializedEndpoint, MqttProducerEndpointConfiguration configuration)

Parameters

serializedEndpoint string

The serialized endpoint.

configuration MqttProducerEndpointConfiguration

The endpoint configuration.

Returns

MqttProducerEndpoint

The deserialized endpoint.

Equals(DynamicProducerEndpointResolver<TMessage, MqttProducerEndpoint, MqttProducerEndpointConfiguration>?)

public override sealed bool Equals(DynamicProducerEndpointResolver<TMessage, MqttProducerEndpoint, MqttProducerEndpointConfiguration>? other)

Parameters

other DynamicProducerEndpointResolver<TMessage, MqttProducerEndpoint, MqttProducerEndpointConfiguration>

Returns

bool

Equals(MqttDynamicProducerEndpointResolver<TMessage>?)

public bool Equals(MqttDynamicProducerEndpointResolver<TMessage>? other)

Parameters

other MqttDynamicProducerEndpointResolver<TMessage>

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetEndpointCore(IOutboundEnvelope<TMessage>, MqttProducerEndpointConfiguration)

Gets the computed actual destination endpoint for the message being produced.

protected override MqttProducerEndpoint GetEndpointCore(IOutboundEnvelope<TMessage> envelope, MqttProducerEndpointConfiguration configuration)

Parameters

envelope IOutboundEnvelope<TMessage>

The envelope containing the message to be produced.

configuration MqttProducerEndpointConfiguration

The endpoint configuration.

Returns

MqttProducerEndpoint

The ProducerEndpoint for the specified message.

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected override bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

SerializeEndpoint(MqttProducerEndpoint)

Serializes the endpoint to a string.

protected override string SerializeEndpoint(MqttProducerEndpoint endpoint)

Parameters

endpoint MqttProducerEndpoint

The endpoint to be serialized.

Returns

string

The serialized endpoint.

ToString()

public override string ToString()

Returns

string

Operators

operator ==(MqttDynamicProducerEndpointResolver<TMessage>?, MqttDynamicProducerEndpointResolver<TMessage>?)

public static bool operator ==(MqttDynamicProducerEndpointResolver<TMessage>? left, MqttDynamicProducerEndpointResolver<TMessage>? right)

Parameters

left MqttDynamicProducerEndpointResolver<TMessage>
right MqttDynamicProducerEndpointResolver<TMessage>

Returns

bool

operator !=(MqttDynamicProducerEndpointResolver<TMessage>?, MqttDynamicProducerEndpointResolver<TMessage>?)

public static bool operator !=(MqttDynamicProducerEndpointResolver<TMessage>? left, MqttDynamicProducerEndpointResolver<TMessage>? right)

Parameters

left MqttDynamicProducerEndpointResolver<TMessage>
right MqttDynamicProducerEndpointResolver<TMessage>

Returns

bool