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
ConstructorsConstructorDescriptionAmqpSourceNativeInfo(org.apache.qpid.protonj2.client.Delivery delivery) Construct native info for a Delivery from AMQP. -
Method Summary
Modifier and TypeMethodDescriptionlongio.aiven.commons.kafka.connector.source.task.Contextorg.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
-
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:
getContextin classio.aiven.commons.kafka.connector.source.AbstractSourceNativeInfo<de.huxhorn.sulky.ulid.ULID.Value,org.apache.qpid.protonj2.client.Delivery>
-
getInputStream
- Specified by:
getInputStreamin classio.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:
estimateInputStreamLengthin classio.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.ClientExceptionGets the AMQP message.- Returns:
- the AMQP message
- Throws:
org.apache.qpid.protonj2.client.exceptions.ClientException- on retrieval error.
-