Class KafkaSignalThread<T extends io.debezium.spi.schema.DataCollectionId>
java.lang.Object
io.debezium.connector.mysql.signal.KafkaSignalThread<T>
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
FieldsModifier and TypeFieldDescriptionstatic final Fieldstatic final Stringprivate final Stringprivate static final Stringprivate final MySqlReadOnlyIncrementalSnapshotChangeEventSource<T>private static final org.slf4j.Loggerprivate final Durationstatic final Fieldstatic final Fieldprivate final ExecutorServiceprivate final String -
Constructor Summary
ConstructorsConstructorDescriptionKafkaSignalThread(Class<? extends org.apache.kafka.connect.source.SourceConnector> connectorType, CommonConnectorConfig connectorConfig, MySqlReadOnlyIncrementalSnapshotChangeEventSource<T> eventSource) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidexecutePause(Document data) private voidexecuteResume(Document data) private voidexecuteSnapshot(Document data, long signalOffset) private voidexecuteStopSnapshot(Document data, long signalOffset) private voidprivate voidprocessSignal(org.apache.kafka.clients.consumer.ConsumerRecord<String, String> record) voidseek(long signalOffset) voidstart()
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
signalTopicListenerExecutor
-
topicName
-
connectorName
-
pollTimeoutMs
-
eventSource
private final MySqlReadOnlyIncrementalSnapshotChangeEventSource<T extends io.debezium.spi.schema.DataCollectionId> eventSource -
signalsConsumer
-
CONFIGURATION_FIELD_PREFIX_STRING
- See Also:
-
CONSUMER_PREFIX
- See Also:
-
SIGNAL_TOPIC
-
BOOTSTRAP_SERVERS
-
SIGNAL_POLL_TIMEOUT_MS
-
-
Constructor Details
-
KafkaSignalThread
public KafkaSignalThread(Class<? extends org.apache.kafka.connect.source.SourceConnector> connectorType, CommonConnectorConfig connectorConfig, MySqlReadOnlyIncrementalSnapshotChangeEventSource<T> eventSource)
-
-
Method Details
-
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
-
executeStopSnapshot
-
executePause
-
executeResume
-
seek
public void seek(long signalOffset)
-