Class KafkaDatabaseHistory

  • All Implemented Interfaces:
    DatabaseHistory

    @NotThreadSafe
    public class KafkaDatabaseHistory
    extends AbstractDatabaseHistory
    A DatabaseHistory implementation that records schema changes as normal SourceRecords on the specified topic, and that recovers the history by establishing a Kafka Consumer re-processing all messages on that topic.
    Author:
    Randall Hauch
    • Field Detail

      • LOGGER

        private static final org.slf4j.Logger LOGGER
      • RETENTION_MS_MIN

        private static final long RETENTION_MS_MIN
      • DEFAULT_TOPIC_REPLICATION_FACTOR_PROP_NAME

        private static final String DEFAULT_TOPIC_REPLICATION_FACTOR_PROP_NAME
        The name of broker property defining default replication factor for topics without the explicit setting.
        See Also:
        kafka.server.KafkaConfig.DefaultReplicationFactorProp, Constant Field Values
      • DEFAULT_TOPIC_REPLICATION_FACTOR

        private static final short DEFAULT_TOPIC_REPLICATION_FACTOR
        The default replication factor for the history topic which is used in case the value couldn't be retrieved from the broker.
        See Also:
        Constant Field Values
      • TOPIC

        public static final Field TOPIC
      • BOOTSTRAP_SERVERS

        public static final Field BOOTSTRAP_SERVERS
      • RECOVERY_POLL_INTERVAL_MS

        public static final Field RECOVERY_POLL_INTERVAL_MS
      • RECOVERY_POLL_ATTEMPTS

        public static final Field RECOVERY_POLL_ATTEMPTS
      • INTERNAL_CONNECTOR_CLASS

        public static final Field INTERNAL_CONNECTOR_CLASS
      • INTERNAL_CONNECTOR_ID

        public static final Field INTERNAL_CONNECTOR_ID
      • ALL_FIELDS

        public static Field.Set ALL_FIELDS
      • KAFKA_QUERY_TIMEOUT

        private static final Duration KAFKA_QUERY_TIMEOUT
      • PARTITION

        private static final Integer PARTITION
        The one and only partition of the history topic.
      • topicName

        private String topicName
      • producer

        private volatile org.apache.kafka.clients.producer.KafkaProducer<String,​String> producer
      • maxRecoveryAttempts

        private int maxRecoveryAttempts
      • pollInterval

        private Duration pollInterval
      • checkTopicSettingsExecutor

        private ExecutorService checkTopicSettingsExecutor
    • Constructor Detail

      • KafkaDatabaseHistory

        public KafkaDatabaseHistory()