Class HeaderExtractor

java.lang.Object
io.aiven.kafka.connect.amqp.common.data.HeaderExtractor

public class HeaderExtractor extends Object
Extracts the Kafka connect headers from the AMQP message.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create the header extractor with the specified data converter.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.kafka.connect.header.Headers
    processHeaders(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. the AmqpHeaderProperties enumeration specifies the AMQP message methods that will be extracted and placed into the specified headers.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HeaderExtractor

      public HeaderExtractor(EncoderDecoder converter)
      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. the AmqpHeaderProperties enumeration specifies the AMQP message methods that will be extracted and placed into the specified headers. See writeObject(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 headers parameter after all updates have been completed.
      Throws:
      org.apache.qpid.protonj2.client.exceptions.ClientException - on AMQP message extraction error