Class MqttDynamicProducerEndpointResolver<TMessage>
Dynamically resolves the target topic for each message being produced.
Inheritance
Implements
Inherited Members
Namespace: Silverback.Messaging.Producing.EndpointResolvers
Assembly: Silverback.Integration.MQTT.dll
Syntax
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
| Name | Description |
|---|---|
| TMessage | The type of the message being produced. |
Constructors
MqttDynamicProducerEndpointResolver(Func<IOutboundEnvelope<TMessage>, string>)
Initializes a new instance of the MqttDynamicProducerEndpointResolver<TMessage> class.
Declaration
public MqttDynamicProducerEndpointResolver(Func<IOutboundEnvelope<TMessage>, string> topicFunction)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<IOutboundEnvelope<TMessage>, string> | topicFunction | The function returning the target topic for the message being produced. |
MqttDynamicProducerEndpointResolver(Func<TMessage?, string>)
Initializes a new instance of the MqttDynamicProducerEndpointResolver<TMessage> class.
Declaration
public MqttDynamicProducerEndpointResolver(Func<TMessage?, string> topicFunction)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<TMessage, string> | topicFunction | 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.
Declaration
public MqttDynamicProducerEndpointResolver(string topicFormatString, Func<IOutboundEnvelope<TMessage>, string[]> topicArgumentsFunction)
Parameters
| Type | Name | Description |
|---|---|---|
| string | topicFormatString | The topic format string that will be combined with the arguments returned by the |
| Func<IOutboundEnvelope<TMessage>, string[]> | topicArgumentsFunction | 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.
Declaration
public MqttDynamicProducerEndpointResolver(string topicFormatString, Func<TMessage?, string[]> topicArgumentsFunction)
Parameters
| Type | Name | Description |
|---|---|---|
| string | topicFormatString | The topic format string that will be combined with the arguments returned by the |
| Func<TMessage, string[]> | topicArgumentsFunction | The function returning the arguments to be used to format the string. |
Properties
EqualityContract
Dynamically resolves the target topic for each message being produced.
Declaration
protected override Type EqualityContract { get; }
Property Value
| Type | Description |
|---|---|
| Type |
Overrides
Methods
DeserializeEndpoint(string, MqttProducerEndpointConfiguration)
Deserializes the endpoint from a string.
Declaration
protected override MqttProducerEndpoint DeserializeEndpoint(string serializedEndpoint, MqttProducerEndpointConfiguration configuration)
Parameters
| Type | Name | Description |
|---|---|---|
| string | serializedEndpoint | The serialized endpoint. |
| MqttProducerEndpointConfiguration | configuration | The endpoint configuration. |
Returns
| Type | Description |
|---|---|
| MqttProducerEndpoint | The deserialized endpoint. |
Overrides
Equals(DynamicProducerEndpointResolver<TMessage, MqttProducerEndpoint, MqttProducerEndpointConfiguration>?)
Dynamically resolves the target topic for each message being produced.
Declaration
public override sealed bool Equals(DynamicProducerEndpointResolver<TMessage, MqttProducerEndpoint, MqttProducerEndpointConfiguration>? other)
Parameters
| Type | Name | Description |
|---|---|---|
| DynamicProducerEndpointResolver<TMessage, MqttProducerEndpoint, MqttProducerEndpointConfiguration> | other |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
Equals(MqttDynamicProducerEndpointResolver<TMessage>?)
Dynamically resolves the target topic for each message being produced.
Declaration
public bool Equals(MqttDynamicProducerEndpointResolver<TMessage>? other)
Parameters
| Type | Name | Description |
|---|---|---|
| MqttDynamicProducerEndpointResolver<TMessage> | other |
Returns
| Type | Description |
|---|---|
| bool |
Equals(object?)
Dynamically resolves the target topic for each message being produced.
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
GetEndpointCore(IOutboundEnvelope<TMessage>, MqttProducerEndpointConfiguration)
Gets the computed actual destination endpoint for the message being produced.
Declaration
protected override MqttProducerEndpoint GetEndpointCore(IOutboundEnvelope<TMessage> envelope, MqttProducerEndpointConfiguration configuration)
Parameters
| Type | Name | Description |
|---|---|---|
| IOutboundEnvelope<TMessage> | envelope | The envelope containing the message to be produced. |
| MqttProducerEndpointConfiguration | configuration | The endpoint configuration. |
Returns
| Type | Description |
|---|---|
| MqttProducerEndpoint | The ProducerEndpoint for the specified message. |
Overrides
GetHashCode()
Dynamically resolves the target topic for each message being produced.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |
Overrides
PrintMembers(StringBuilder)
Dynamically resolves the target topic for each message being produced.
Declaration
protected override bool PrintMembers(StringBuilder builder)
Parameters
| Type | Name | Description |
|---|---|---|
| StringBuilder | builder |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
SerializeEndpoint(MqttProducerEndpoint)
Serializes the endpoint to a string.
Declaration
protected override string SerializeEndpoint(MqttProducerEndpoint endpoint)
Parameters
| Type | Name | Description |
|---|---|---|
| MqttProducerEndpoint | endpoint | The endpoint to be serialized. |
Returns
| Type | Description |
|---|---|
| string | The serialized endpoint. |
Overrides
ToString()
Dynamically resolves the target topic for each message being produced.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |
Overrides
Operators
operator ==(MqttDynamicProducerEndpointResolver<TMessage>?, MqttDynamicProducerEndpointResolver<TMessage>?)
Dynamically resolves the target topic for each message being produced.
Declaration
public static bool operator ==(MqttDynamicProducerEndpointResolver<TMessage>? left, MqttDynamicProducerEndpointResolver<TMessage>? right)
Parameters
| Type | Name | Description |
|---|---|---|
| MqttDynamicProducerEndpointResolver<TMessage> | left | |
| MqttDynamicProducerEndpointResolver<TMessage> | right |
Returns
| Type | Description |
|---|---|
| bool |
operator !=(MqttDynamicProducerEndpointResolver<TMessage>?, MqttDynamicProducerEndpointResolver<TMessage>?)
Dynamically resolves the target topic for each message being produced.
Declaration
public static bool operator !=(MqttDynamicProducerEndpointResolver<TMessage>? left, MqttDynamicProducerEndpointResolver<TMessage>? right)
Parameters
| Type | Name | Description |
|---|---|---|
| MqttDynamicProducerEndpointResolver<TMessage> | left | |
| MqttDynamicProducerEndpointResolver<TMessage> | right |
Returns
| Type | Description |
|---|---|
| bool |