Skip to content

Commit

Permalink
[ISSUE #558] An ugly solution for fetch topic list error
Browse files Browse the repository at this point in the history
  • Loading branch information
imaffe authored Jul 27, 2020
1 parent 9849db6 commit 1a49e60
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.util.Set;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
import org.apache.rocketmq.client.exception.MQClientException;
Expand Down Expand Up @@ -43,6 +44,7 @@ public class JdbcSinkConnector extends SinkConnector {

private volatile boolean adminStarted;

private ScheduledFuture<?> listenerHandle;
public JdbcSinkConnector() {
topicRouteMap = new HashMap<>();
dbConnectorConfig = new SinkDbConnectorConfig();
Expand Down Expand Up @@ -94,7 +96,7 @@ public void start() {
}

public void startListener() {
executor.scheduleAtFixedRate(new Runnable() {
listenerHandle = executor.scheduleAtFixedRate(new Runnable() {
boolean first = true;
HashMap<String, Set<TaskTopicInfo>> origin = null;

Expand Down Expand Up @@ -169,9 +171,10 @@ public void buildRoute() {
}
}


@Override
public void stop() {

listenerHandle.cancel(true);
}

@Override
Expand Down

0 comments on commit 1a49e60

Please sign in to comment.