Interface IMetadata
- Assembly
- Solace.SchemaRegistry.Serdes.Core.dll
Represents metadata associated with a data record, including routing information and headers. This interface provides access to contextual information that accompanies data during serialization and deserialization operations.
public interface IMetadata
Remarks
IMetadata contains the contextual information that is associated with data records during messaging operations. This includes the destination name (topic or queue) and any additional headers that provide metadata about the message or its processing.
The metadata is typically used by schema resolvers and serializers to make decisions about schema selection, routing, and processing behavior. Headers may contain schema identifiers, content types, or other application-specific metadata.
Properties
DestinationName
Gets the name of the destination where the data is being sent or was received from.
string DestinationName { get; }
Property Value
- string
A string representing the destination name, typically a topic name, queue name, or other routing identifier used by the messaging system.
Remarks
The destination name is used by schema resolvers and serializers to determine the appropriate schema or processing behavior for the data. Different destinations may have different schema requirements or versioning policies.
This property should never return null, as the destination name is essential for proper message routing and schema resolution.
Headers
Gets a dictionary of headers containing additional metadata associated with the data record.
IDictionary<string, object> Headers { get; }
Property Value
- IDictionary<string, object>
An IDictionary<TKey, TValue> where keys are header names (strings) and values are header values (objects). Returns an empty dictionary if no headers are present.
Remarks
Headers provide a mechanism for passing additional metadata along with the data record. Common header types include schema identifiers, content types, message timestamps, correlation IDs, and application-specific metadata.
The headers dictionary should be treated as read-only during processing to avoid unintended side effects. Header values can be of various types depending on the messaging system and application requirements.