Package io.debezium.connector.common
Class DebeziumHeaderProducer
java.lang.Object
io.debezium.connector.common.DebeziumHeaderProducer
- All Implemented Interfaces:
Service
A service implementation that produces Debezium-specific headers for CDC (Change Data Capture) events.
This class is responsible for creating standardized headers containing metadata about the Debezium connector context, which can be attached to Kafka Connect records to provide traceability and identification information.
- Author:
- Mario Fiore Vitale
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDebeziumHeaderProducer(CdcSourceTaskContext sourceTaskContext) Constructs a new DebeziumHeaderProducer with the specified source task context. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.kafka.connect.header.ConnectHeadersCreates and returns a set of standardized Debezium context headers.
-
Field Details
-
sourceTaskContext
-
-
Constructor Details
-
DebeziumHeaderProducer
Constructs a new DebeziumHeaderProducer with the specified source task context.- Parameters:
sourceTaskContext- the CDC source task context containing connector metadata; must not be null
-
-
Method Details
-
contextHeaders
public org.apache.kafka.connect.header.ConnectHeaders contextHeaders()Creates and returns a set of standardized Debezium context headers.The returned headers include:
- Connector Logical Name - The logical name of the Debezium connector
- Task ID - The unique identifier of the connector task
- Connector Name - The name of the Debezium connector
These headers provide essential metadata for tracking and identifying the source of CDC events in downstream processing systems.
- Returns:
- a
ConnectHeadersobject containing the Debezium context headers; never returns null - Throws:
RuntimeException- if there's an error accessing the source task context
-