Class KafkaSignalThread<T extends DataCollectionId>
- java.lang.Object
-
- io.debezium.connector.mysql.signal.KafkaSignalThread<T>
-
public class KafkaSignalThread<T extends DataCollectionId> extends Object
The class responsible for processing of signals delivered to Debezium via a dedicated Kafka topic. The signal message must have the following structure:id STRING- the unique identifier of the signal sent, usually UUID, can be used for deduplicationtype STRING- the unique logical name of the code executing the signaldata STRING- the data in JSON format that are passed to the signal code
-
-
Field Summary
Fields Modifier and Type Field Description static FieldBOOTSTRAP_SERVERSstatic StringCONFIGURATION_FIELD_PREFIX_STRINGprivate StringconnectorNameprivate static StringCONSUMER_PREFIXprivate MySqlReadOnlyIncrementalSnapshotChangeEventSource<T>eventSourceprivate static org.slf4j.LoggerLOGGERprivate DurationpollTimeoutMsstatic FieldSIGNAL_POLL_TIMEOUT_MSstatic FieldSIGNAL_TOPICprivate org.apache.kafka.clients.consumer.KafkaConsumer<String,String>signalsConsumerprivate ExecutorServicesignalTopicListenerExecutorprivate StringtopicName
-
Constructor Summary
Constructors Constructor Description KafkaSignalThread(Class<? extends org.apache.kafka.connect.source.SourceConnector> connectorType, CommonConnectorConfig connectorConfig, MySqlReadOnlyIncrementalSnapshotChangeEventSource<T> eventSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidexecuteSnapshot(Document data, long signalOffset)private voidmonitorSignals()private voidprocessSignal(org.apache.kafka.clients.consumer.ConsumerRecord<String,String> record)voidseek(long signalOffset)voidstart()
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
signalTopicListenerExecutor
private final ExecutorService signalTopicListenerExecutor
-
topicName
private final String topicName
-
connectorName
private final String connectorName
-
pollTimeoutMs
private final Duration pollTimeoutMs
-
eventSource
private final MySqlReadOnlyIncrementalSnapshotChangeEventSource<T extends DataCollectionId> eventSource
-
signalsConsumer
private final org.apache.kafka.clients.consumer.KafkaConsumer<String,String> signalsConsumer
-
CONFIGURATION_FIELD_PREFIX_STRING
public static final String CONFIGURATION_FIELD_PREFIX_STRING
- See Also:
- Constant Field Values
-
CONSUMER_PREFIX
private static final String CONSUMER_PREFIX
- See Also:
- Constant Field Values
-
SIGNAL_TOPIC
public static final Field SIGNAL_TOPIC
-
BOOTSTRAP_SERVERS
public static final Field BOOTSTRAP_SERVERS
-
SIGNAL_POLL_TIMEOUT_MS
public static final Field SIGNAL_POLL_TIMEOUT_MS
-
-
Constructor Detail
-
KafkaSignalThread
public KafkaSignalThread(Class<? extends org.apache.kafka.connect.source.SourceConnector> connectorType, CommonConnectorConfig connectorConfig, MySqlReadOnlyIncrementalSnapshotChangeEventSource<T> eventSource)
-
-
Method Detail
-
start
public void start()
-
monitorSignals
private void monitorSignals()
-
processSignal
private void processSignal(org.apache.kafka.clients.consumer.ConsumerRecord<String,String> record) throws IOException, InterruptedException
- Throws:
IOExceptionInterruptedException
-
executeSnapshot
private void executeSnapshot(Document data, long signalOffset)
-
seek
public void seek(long signalOffset)
-
-