Method Serialize
Serialize(T, SerializationContext)
Writes a value without a task once the topic's schema ID is known; until then, and with settings whose rules can run asynchronously, it waits for SerializeAsync(T, SerializationContext).
[SuppressMessage("Usage", "VSTHRD002:Avoid problematic synchronous waits", Justification = "Confluent.Kafka's synchronous interface: it waits only until the topic's schema ID is known, or with settings whose rules can run asynchronously.")]
public byte[]? Serialize(T data, SerializationContext context)
Parameters
dataTThe value. A null reference is written as no message body.
contextSerializationContextThe topic, the component (key or value) and the headers.