Skip to content

Commit c6e86bb

Browse files
committed
DBZ-8948 Add polling start and stop events
1 parent 414616c commit c6e86bb

3 files changed

Lines changed: 38 additions & 0 deletions

File tree

debezium-server-core/src/main/java/io/debezium/server/ConnectorLifecycle.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
package io.debezium.server;
77

8+
import io.debezium.server.events.PollingStartedEvent;
9+
import io.debezium.server.events.PollingStoppedEvent;
810
import jakarta.enterprise.context.ApplicationScoped;
911
import jakarta.enterprise.event.Event;
1012
import jakarta.inject.Inject;
@@ -49,6 +51,12 @@ public class ConnectorLifecycle implements HealthCheck, DebeziumEngine.Connector
4951
@Inject
5052
Event<TaskStoppedEvent> taskStoppedEvent;
5153

54+
@Inject
55+
Event<PollingStartedEvent> pollingStartedEvent;
56+
57+
@Inject
58+
Event<PollingStoppedEvent> pollingStoppedEvent;
59+
5260
@Inject
5361
Event<ConnectorCompletedEvent> connectorCompletedEvent;
5462

@@ -77,6 +85,18 @@ public void taskStopped() {
7785
taskStoppedEvent.fire(new TaskStoppedEvent());
7886
}
7987

88+
@Override
89+
public void pollingStarted() {
90+
LOGGER.debug("Polling started");
91+
pollingStartedEvent.fire(new PollingStartedEvent());
92+
}
93+
94+
@Override
95+
public void pollingStopped() {
96+
LOGGER.debug("Polling stopped");
97+
pollingStoppedEvent.fire(new PollingStoppedEvent());
98+
}
99+
80100
@Override
81101
public void handle(boolean success, String message, Throwable error) {
82102
String logMessage = String.format("Connector completed: success = '%s', message = '%s', error = '%s'", success, message, error);
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package io.debezium.server.events;
2+
3+
/**
4+
* Fired right before creating polling loop.
5+
*
6+
* @author vjuranek
7+
*/
8+
public class PollingStartedEvent {
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package io.debezium.server.events;
2+
3+
/**
4+
* Fired once the polling loop is finished.
5+
*
6+
* @author vjuranek
7+
*/
8+
public class PollingStoppedEvent {
9+
}

0 commit comments

Comments
 (0)