Class DynamicProducerEndpointResolver<TMessage, TEndpoint, TConfiguration>
Dynamically resolves the destination endpoint (e.g. the target topic and partition) for each message being produced.
Inheritance
Implements
Inherited Members
Namespace: Silverback.Messaging.Producing.EndpointResolvers
Assembly: Silverback.Integration.dll
Syntax
public abstract record DynamicProducerEndpointResolver<TMessage, TEndpoint, TConfiguration> : IDynamicProducerEndpointResolver<TEndpoint>, IDynamicProducerEndpointResolver, IProducerEndpointResolver<TEndpoint>, IProducerEndpointResolver, IEquatable<DynamicProducerEndpointResolver<TMessage, TEndpoint, TConfiguration>> where TMessage : class where TEndpoint : ProducerEndpoint where TConfiguration : ProducerEndpointConfiguration
Type Parameters
| Name | Description |
|---|---|
| TMessage | The type of the message being produced. |
| TEndpoint | The type of the endpoint being resolved. |
| TConfiguration | The type of the endpoint configuration. |
Constructors
DynamicProducerEndpointResolver(DynamicProducerEndpointResolver<TMessage, TEndpoint, TConfiguration>)
Dynamically resolves the destination endpoint (e.g. the target topic and partition) for each message being produced.
Declaration
protected DynamicProducerEndpointResolver(DynamicProducerEndpointResolver<TMessage, TEndpoint, TConfiguration> original)
Parameters
| Type | Name | Description |
|---|---|---|
| DynamicProducerEndpointResolver<TMessage, TEndpoint, TConfiguration> | original |
DynamicProducerEndpointResolver(string)
Initializes a new instance of the DynamicProducerEndpointResolver<TMessage, TEndpoint, TConfiguration> class.
Declaration
protected DynamicProducerEndpointResolver(string rawName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | rawName | The raw endpoint name that can be used as RawName. |
Properties
EqualityContract
Dynamically resolves the destination endpoint (e.g. the target topic and partition) for each message being produced.
Declaration
protected virtual Type EqualityContract { get; }
Property Value
| Type | Description |
|---|---|
| Type |
RawName
Gets the raw endpoint name that can be used as RawName.
Declaration
public string RawName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
DeserializeEndpoint(string, TConfiguration)
Deserializes the endpoint from a string.
Declaration
protected abstract TEndpoint DeserializeEndpoint(string serializedEndpoint, TConfiguration configuration)
Parameters
| Type | Name | Description |
|---|---|---|
| string | serializedEndpoint | The serialized endpoint. |
| TConfiguration | configuration | The endpoint configuration. |
Returns
| Type | Description |
|---|---|
| TEndpoint | The deserialized endpoint. |
Equals(DynamicProducerEndpointResolver<TMessage, TEndpoint, TConfiguration>?)
Dynamically resolves the destination endpoint (e.g. the target topic and partition) for each message being produced.
Declaration
public virtual bool Equals(DynamicProducerEndpointResolver<TMessage, TEndpoint, TConfiguration>? other)
Parameters
| Type | Name | Description |
|---|---|---|
| DynamicProducerEndpointResolver<TMessage, TEndpoint, TConfiguration> | other |
Returns
| Type | Description |
|---|---|
| bool |
Equals(object?)
Dynamically resolves the destination endpoint (e.g. the target topic and partition) for each message being produced.
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
GetEndpoint(IOutboundEnvelope)
Gets the computed actual destination endpoint for the message being produced.
Declaration
public ProducerEndpoint GetEndpoint(IOutboundEnvelope envelope)
Parameters
| Type | Name | Description |
|---|---|---|
| IOutboundEnvelope | envelope | The envelope containing the message to be produced. |
Returns
| Type | Description |
|---|---|
| ProducerEndpoint | The ProducerEndpoint for the specified message. |
GetEndpoint(IOutboundEnvelope, TConfiguration)
Gets the computed actual destination endpoint for the message being produced.
Declaration
public TEndpoint GetEndpoint(IOutboundEnvelope envelope, TConfiguration configuration)
Parameters
| Type | Name | Description |
|---|---|---|
| IOutboundEnvelope | envelope | The envelope containing the message to be produced. |
| TConfiguration | configuration |
Returns
| Type | Description |
|---|---|
| TEndpoint | The ProducerEndpoint for the specified message. |
GetEndpointCore(IOutboundEnvelope<TMessage>, TConfiguration)
Gets the computed actual destination endpoint for the message being produced.
Declaration
protected abstract TEndpoint GetEndpointCore(IOutboundEnvelope<TMessage> envelope, TConfiguration configuration)
Parameters
| Type | Name | Description |
|---|---|---|
| IOutboundEnvelope<TMessage> | envelope | The envelope containing the message to be produced. |
| TConfiguration | configuration | The endpoint configuration. |
Returns
| Type | Description |
|---|---|
| TEndpoint | The ProducerEndpoint for the specified message. |
GetHashCode()
Dynamically resolves the destination endpoint (e.g. the target topic and partition) for each message being produced.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |
Overrides
GetSerializedEndpoint(IOutboundEnvelope)
Gets the string representation of the computed actual destination endpoint for the message being produced.
Declaration
public string GetSerializedEndpoint(IOutboundEnvelope envelope)
Parameters
| Type | Name | Description |
|---|---|---|
| IOutboundEnvelope | envelope | The envelope containing the message to be produced. |
Returns
| Type | Description |
|---|---|
| string | The ProducerEndpoint for the specified message. |
PrintMembers(StringBuilder)
Dynamically resolves the destination endpoint (e.g. the target topic and partition) for each message being produced.
Declaration
protected virtual bool PrintMembers(StringBuilder builder)
Parameters
| Type | Name | Description |
|---|---|---|
| StringBuilder | builder |
Returns
| Type | Description |
|---|---|
| bool |
SerializeEndpoint(TEndpoint)
Serializes the endpoint to a string.
Declaration
protected abstract string SerializeEndpoint(TEndpoint endpoint)
Parameters
| Type | Name | Description |
|---|---|---|
| TEndpoint | endpoint | The endpoint to be serialized. |
Returns
| Type | Description |
|---|---|
| string | The serialized endpoint. |
ToString()
Dynamically resolves the destination endpoint (e.g. the target topic and partition) for each message being produced.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |
Overrides
Operators
operator ==(DynamicProducerEndpointResolver<TMessage, TEndpoint, TConfiguration>?, DynamicProducerEndpointResolver<TMessage, TEndpoint, TConfiguration>?)
Dynamically resolves the destination endpoint (e.g. the target topic and partition) for each message being produced.
Declaration
public static bool operator ==(DynamicProducerEndpointResolver<TMessage, TEndpoint, TConfiguration>? left, DynamicProducerEndpointResolver<TMessage, TEndpoint, TConfiguration>? right)
Parameters
| Type | Name | Description |
|---|---|---|
| DynamicProducerEndpointResolver<TMessage, TEndpoint, TConfiguration> | left | |
| DynamicProducerEndpointResolver<TMessage, TEndpoint, TConfiguration> | right |
Returns
| Type | Description |
|---|---|
| bool |
operator !=(DynamicProducerEndpointResolver<TMessage, TEndpoint, TConfiguration>?, DynamicProducerEndpointResolver<TMessage, TEndpoint, TConfiguration>?)
Dynamically resolves the destination endpoint (e.g. the target topic and partition) for each message being produced.
Declaration
public static bool operator !=(DynamicProducerEndpointResolver<TMessage, TEndpoint, TConfiguration>? left, DynamicProducerEndpointResolver<TMessage, TEndpoint, TConfiguration>? right)
Parameters
| Type | Name | Description |
|---|---|---|
| DynamicProducerEndpointResolver<TMessage, TEndpoint, TConfiguration> | left | |
| DynamicProducerEndpointResolver<TMessage, TEndpoint, TConfiguration> | right |
Returns
| Type | Description |
|---|---|
| bool |