Class OffsetPartitionAssignmentAdapter

java.lang.Object
org.apache.camel.component.kafka.consumer.support.classic.OffsetPartitionAssignmentAdapter
All Implemented Interfaces:
PartitionAssignmentAdapter

public class OffsetPartitionAssignmentAdapter extends Object implements PartitionAssignmentAdapter
A resume strategy that uses Kafka's offset for resuming
  • Constructor Details

    • OffsetPartitionAssignmentAdapter

      public OffsetPartitionAssignmentAdapter(org.apache.camel.spi.StateRepository<String,String> offsetRepository)
  • Method Details

    • setConsumer

      public void setConsumer(org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
      Description copied from interface: PartitionAssignmentAdapter
      Sets the Kafka consumer instance for the adapter. Please note that the Kafka consumer is not safe for concurrent access
      Specified by:
      setConsumer in interface PartitionAssignmentAdapter
      Parameters:
      consumer - the consumer instance
    • handlePartitionAssignment

      public void handlePartitionAssignment()
      Description copied from interface: PartitionAssignmentAdapter
      Callback for custom logic when partitions has been assigned.
      Specified by:
      handlePartitionAssignment in interface PartitionAssignmentAdapter
    • serializeOffsetKey

      public static String serializeOffsetKey(org.apache.kafka.common.TopicPartition topicPartition)
    • deserializeOffsetValue

      public static long deserializeOffsetValue(String offset)