Class DefaultHeadersHandler
java.lang.Object
io.apicurio.registry.serde.kafka.headers.DefaultHeadersHandler
- All Implemented Interfaces:
HeadersHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanChecks if schema reading from headers is enabled.io.apicurio.registry.resolver.strategy.ArtifactReferencereadHeaders(org.apache.kafka.common.header.Headers headers) Reads the kafka message headers and returns an ArtifactReference that can contain or not information to identify an Artifact in the registry.readSchemaFromHeaders(org.apache.kafka.common.header.Headers headers) Reads the schema content from the headers.readSchemaTypeFromHeaders(org.apache.kafka.common.header.Headers headers) Reads the schema type from the headers.voidwriteHeaders(org.apache.kafka.common.header.Headers headers, io.apicurio.registry.resolver.strategy.ArtifactReference reference) voidwriteSchemaToHeaders(org.apache.kafka.common.header.Headers headers, String schemaContent) Writes the schema content to the headers.voidwriteSchemaTypeToHeaders(org.apache.kafka.common.header.Headers headers, String schemaType) Writes the schema type to the headers.
-
Constructor Details
-
DefaultHeadersHandler
public DefaultHeadersHandler()
-
-
Method Details
-
configure
- Specified by:
configurein interfaceHeadersHandler- See Also:
-
writeHeaders
public void writeHeaders(org.apache.kafka.common.header.Headers headers, io.apicurio.registry.resolver.strategy.ArtifactReference reference) - Specified by:
writeHeadersin interfaceHeadersHandler- See Also:
-
readHeaders
public io.apicurio.registry.resolver.strategy.ArtifactReference readHeaders(org.apache.kafka.common.header.Headers headers) Description copied from interface:HeadersHandlerReads the kafka message headers and returns an ArtifactReference that can contain or not information to identify an Artifact in the registry.- Specified by:
readHeadersin interfaceHeadersHandler- Parameters:
headers-- Returns:
- ArtifactReference
- See Also:
-
isUseSchemaFromHeaders
public boolean isUseSchemaFromHeaders()Checks if schema reading from headers is enabled.- Returns:
- true if schema should be read from headers
-
readSchemaFromHeaders
Reads the schema content from the headers.- Parameters:
headers- the Kafka message headers- Returns:
- the schema content as a string, or null if not present
-
readSchemaTypeFromHeaders
Reads the schema type from the headers.- Parameters:
headers- the Kafka message headers- Returns:
- the schema type as a string (e.g., "AVRO", "PROTOBUF", "JSON"), or null if not present
-
writeSchemaToHeaders
public void writeSchemaToHeaders(org.apache.kafka.common.header.Headers headers, String schemaContent) Writes the schema content to the headers.- Parameters:
headers- the Kafka message headersschemaContent- the schema content to write
-
writeSchemaTypeToHeaders
public void writeSchemaTypeToHeaders(org.apache.kafka.common.header.Headers headers, String schemaType) Writes the schema type to the headers.- Parameters:
headers- the Kafka message headersschemaType- the schema type to write (e.g., "AVRO", "PROTOBUF", "JSON")
-