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 Field
BOOTSTRAP_SERVERS
static String
CONFIGURATION_FIELD_PREFIX_STRING
private String
connectorName
private static String
CONSUMER_PREFIX
private MySqlReadOnlyIncrementalSnapshotChangeEventSource<T>
eventSource
private static org.slf4j.Logger
LOGGER
private Duration
pollTimeoutMs
static Field
SIGNAL_POLL_TIMEOUT_MS
static Field
SIGNAL_TOPIC
private org.apache.kafka.clients.consumer.KafkaConsumer<String,String>
signalsConsumer
private ExecutorService
signalTopicListenerExecutor
private String
topicName
-
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 void
executeSnapshot(Document data, long signalOffset)
private void
monitorSignals()
private void
processSignal(org.apache.kafka.clients.consumer.ConsumerRecord<String,String> record)
void
seek(long signalOffset)
void
start()
-
-
-
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:
IOException
InterruptedException
-
executeSnapshot
private void executeSnapshot(Document data, long signalOffset)
-
seek
public void seek(long signalOffset)
-
-