Class AmqpSourceNativeInfo

java.lang.Object
io.aiven.commons.kafka.connector.source.AbstractSourceNativeInfo<de.huxhorn.sulky.ulid.ULID.Value,org.apache.qpid.protonj2.client.Delivery>
io.aiven.kafka.connect.amqp.source.AmqpSourceNativeInfo
All Implemented Interfaces:
Comparable<io.aiven.commons.kafka.connector.source.AbstractSourceNativeInfo<de.huxhorn.sulky.ulid.ULID.Value,org.apache.qpid.protonj2.client.Delivery>>

public final class AmqpSourceNativeInfo extends io.aiven.commons.kafka.connector.source.AbstractSourceNativeInfo<de.huxhorn.sulky.ulid.ULID.Value,org.apache.qpid.protonj2.client.Delivery>
Wraps ULID.Value and the Delivery for a streaming object. The framework requires a NativeInfo that has both the key and the value associated with that key. This implementation creates a ULID value for every Delivery from AMQP.
  • Field Summary

    Fields inherited from class io.aiven.commons.kafka.connector.source.AbstractSourceNativeInfo

    nativeInfo, UNKNOWN_STREAM_LENGTH
  • Constructor Summary

    Constructors
    Constructor
    Description
    AmqpSourceNativeInfo(org.apache.qpid.protonj2.client.Delivery delivery)
    Construct native info for a Delivery from AMQP.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
     
    io.aiven.commons.kafka.connector.source.task.Context
     
     
    org.apache.qpid.protonj2.client.Message<Object>
    Gets the AMQP message.

    Methods inherited from class io.aiven.commons.kafka.connector.source.AbstractSourceNativeInfo

    compareTo, getInputStreamSupplier, nativeKey, toString

    Methods inherited from class java.lang.Object

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

    • AmqpSourceNativeInfo

      public AmqpSourceNativeInfo(org.apache.qpid.protonj2.client.Delivery delivery)
      Construct native info for a Delivery from AMQP.
      Parameters:
      delivery - the AMQP delivery object to process.
  • Method Details

    • getContext

      public io.aiven.commons.kafka.connector.source.task.Context getContext()
      Specified by:
      getContext in class io.aiven.commons.kafka.connector.source.AbstractSourceNativeInfo<de.huxhorn.sulky.ulid.ULID.Value,org.apache.qpid.protonj2.client.Delivery>
    • getInputStream

      public InputStream getInputStream() throws IOException
      Specified by:
      getInputStream in class io.aiven.commons.kafka.connector.source.AbstractSourceNativeInfo<de.huxhorn.sulky.ulid.ULID.Value,org.apache.qpid.protonj2.client.Delivery>
      Throws:
      IOException
    • estimateInputStreamLength

      public long estimateInputStreamLength()
      Specified by:
      estimateInputStreamLength in class io.aiven.commons.kafka.connector.source.AbstractSourceNativeInfo<de.huxhorn.sulky.ulid.ULID.Value,org.apache.qpid.protonj2.client.Delivery>
    • getMessage

      public org.apache.qpid.protonj2.client.Message<Object> getMessage() throws org.apache.qpid.protonj2.client.exceptions.ClientException
      Gets the AMQP message.
      Returns:
      the AMQP message
      Throws:
      org.apache.qpid.protonj2.client.exceptions.ClientException - on retrieval error.