Class HeaderExtractor
java.lang.Object
io.aiven.kafka.connect.amqp.common.data.HeaderExtractor
Extracts the Kafka connect headers from the AMQP message.
-
Constructor Summary
ConstructorsConstructorDescriptionHeaderExtractor(EncoderDecoder converter) Create the header extractor with the specified data converter. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.kafka.connect.header.HeadersprocessHeaders(org.apache.kafka.connect.header.Headers headers, org.apache.qpid.protonj2.client.Message<?> message) processes the message and writes all non-body AMQP values into Kafka connect headers. theAmqpHeaderPropertiesenumeration specifies the AMQP message methods that will be extracted and placed into the specified headers.
-
Constructor Details
-
HeaderExtractor
Create the header extractor with the specified data converter.- Parameters:
converter- the Data converter to use.
-
-
Method Details
-
processHeaders
public org.apache.kafka.connect.header.Headers processHeaders(org.apache.kafka.connect.header.Headers headers, org.apache.qpid.protonj2.client.Message<?> message) throws org.apache.qpid.protonj2.client.exceptions.ClientException processes the message and writes all non-body AMQP values into Kafka connect headers. theAmqpHeaderPropertiesenumeration specifies the AMQP message methods that will be extracted and placed into the specified headers. SeewriteObject(org.apache.kafka.connect.header.Headers, java.lang.String, java.lang.Object)for discussion of value encoding and header naming.In addition to the listed properties, all annotations and footers will be encoded as map objects in the "amqp.annotations" and "amqp.footers" headers respectively.
- Parameters:
headers- the Kafka connect headers to update.message- the AMQP message to parse.- Returns:
- the
headersparameter after all updates have been completed. - Throws:
org.apache.qpid.protonj2.client.exceptions.ClientException- on AMQP message extraction error
-