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
Modifier and TypeFieldDescriptionstatic final Field
static final String
private final String
private static final String
private final MySqlReadOnlyIncrementalSnapshotChangeEventSource<T>
private static final org.slf4j.Logger
private final Duration
static final Field
static final Field
private final ExecutorService
private final String
-
Constructor Summary
ConstructorDescriptionKafkaSignalThread
(Class<? extends org.apache.kafka.connect.source.SourceConnector> connectorType, CommonConnectorConfig connectorConfig, MySqlReadOnlyIncrementalSnapshotChangeEventSource<T> eventSource) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
executePause
(Document data) private void
executeResume
(Document data) private void
executeSnapshot
(Document data, long signalOffset) private void
executeStopSnapshot
(Document data, long signalOffset) private void
private void
processSignal
(org.apache.kafka.clients.consumer.ConsumerRecord<String, String> record) void
seek
(long signalOffset) void
start()
-
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:
IOException
InterruptedException
-
executeSnapshot
-
executeStopSnapshot
-
executePause
-
executeResume
-
seek
public void seek(long signalOffset)
-