Class IncomingKafkaRecord<K,​T>

    • Constructor Detail

      • IncomingKafkaRecord

        public IncomingKafkaRecord​(org.apache.kafka.clients.consumer.ConsumerRecord<K,​T> record,
                                   KafkaCommitHandler commitHandler,
                                   KafkaFailureHandler onNack,
                                   boolean cloudEventEnabled,
                                   boolean tracingEnabled)
    • Method Detail

      • getPayload

        public T getPayload()
        Specified by:
        getPayload in interface Message<K>
        Returns:
        The payload for this message.
      • getHeaders

        public org.apache.kafka.common.header.Headers getHeaders()
        Specified by:
        getHeaders in interface KafkaRecord<K,​T>
      • getOffset

        public long getOffset()
      • getMetadata

        public Metadata getMetadata()
        Specified by:
        getMetadata in interface Message<K>
        Returns:
        The set of metadata attached to this message, potentially empty.
      • ack

        public CompletionStage<Void> ack()
        Description copied from interface: Message
        Acknowledge this message.
        Specified by:
        ack in interface Message<K>
        Returns:
        a completion stage completed when the message is acknowledged. If the acknowledgement fails, the completion stage propagates the failure.
      • nack

        public CompletionStage<Void> nack​(Throwable reason,
                                          Metadata metadata)
        Description copied from interface: Message
        Acknowledge negatively this message. nack is used to indicate that the processing of a message failed. The reason is passed as parameter. Additional metadata may be provided that the connector can use when nacking the message. The interpretation of metadata is connector-specific.
        Specified by:
        nack in interface Message<K>
        Parameters:
        reason - the reason of the nack, must not be null
        metadata - additional nack metadata the connector may use, may be null
        Returns:
        a completion stage completed when the message is negative-acknowledgement has completed. If the negative acknowledgement fails, the completion stage propagates the failure.
      • injectTracingMetadata

        public void injectTracingMetadata​(TracingMetadata tracingMetadata)