Class DestinationIdStrategy<T, S>
- Assembly
- Solace.SchemaRegistry.Serdes.Core.dll
A strategy for resolving artifact references based on destination names.
public class DestinationIdStrategy<T, S> : IArtifactReferenceResolverStrategy<T, S>
Type Parameters
TThe type of object to be serialized
SThe type of schema
- Inheritance
-
DestinationIdStrategy<T, S>
- Implements
- Derived
- Inherited Members
Remarks
This strategy uses the destination name from the record's metadata as the artifact ID and uses the default group ID. It requires that the record's metadata and destination name are non-null and non-empty.
This strategy does not require schema loading during resolution, as it derives all necessary information from the record's metadata alone.
Properties
LoadSchema
Gets a value indicating whether this strategy requires schema loading during resolution.
public bool LoadSchema { get; }
Property Value
- bool
Always returns
falsebecause this strategy derives artifact references solely from the record's metadata and does not need schema content.
Methods
ResolveArtifactReference(IRecord<T>, IParsedSchema<S>)
Resolves an artifact reference using the destination name from the record's metadata.
public virtual IArtifactReference ResolveArtifactReference(IRecord<T> data, IParsedSchema<S> schema)
Parameters
dataIRecord<T>The data record containing the metadata with destination name
schemaIParsedSchema<S>The parsed schema (not used by this strategy)
Returns
- IArtifactReference
An IArtifactReference with the destination name as the artifact ID and the default group ID.
Exceptions
- ArgumentNullException
Thrown when metadata is null.
- ArgumentException
Thrown when the destination name is null or empty.