apache / rocketmq-externals

Mirror of Apache RocketMQ (Incubating)
4.55k stars 3.07k forks source link

[rocketmq-connect-jdbc] Possible enhancements recorder #549

Open gripson opened 4 years ago

gripson commented 4 years ago

The issue tracker is ONLY used for bug report and feature request.

Any question or RocketMQ proposal please use our mailing lists.

BUG LIST

This is a recording for issues I've met when deploying rocketmq-connect-runtime, and there are not many core-related or performance enhancements I can observe now, so I'll just put some simple enhancements as candidates.

The solution could be movingsrcMQAdminExt.shutdown() funtion from buildRoute() to stop(), while addingadminStarted = false; and cancel logic of executor.scheduleAtFixedRate(..) to the jdbcSinkConnector stop() function, as well as replace startMQAdminTools(); and buildRoute(); with alternative function to get latest topic route info in taskConfigs()function of jdbcSinkConnector.

However, it will bring about a consequence that the performance of the system reduces because if there will be more than one jdbcSinkConnectors created, each of them will have a schedule thread to check topic route info regually. Therefore I am going to think if there will be bette solution.

2020-04-06 09:53:34 ERROR JdbcSinkConnector-SinkWatcher-1 - Fetch topic list error.
org.apache.rocketmq.remoting.exception.RemotingConnectException: connect to <null> failed
        at org.apache.rocketmq.remoting.netty.NettyRemotingClient.invokeSync(NettyRemotingClient.java:392) ~[rocketmq-connect-jdbc-0.0.1-SNAPSHOT-jar-with-dependencies.jar:4.5.2]
        at org.apache.rocketmq.client.impl.MQClientAPIImpl.getTopicRouteInfoFromNameServer(MQClientAPIImpl.java:1331) ~[rocketmq-connect-jdbc-0.0.1-SNAPSHOT-jar-with-dependencies.jar:4.5.2]
        at org.apache.rocketmq.client.impl.MQClientAPIImpl.getTopicRouteInfoFromNameServer(MQClientAPIImpl.java:1321) ~[rocketmq-connect-jdbc-0.0.1-SNAPSHOT-jar-with-dependencies.jar:4.5.2]
        at org.apache.rocketmq.tools.admin.DefaultMQAdminExtImpl.examineTopicRouteInfo(DefaultMQAdminExtImpl.java:305) ~[rocketmq-connect-jdbc-0.0.1-SNAPSHOT-jar-with-dependencies.jar:na]
        at org.apache.rocketmq.tools.admin.DefaultMQAdminExt.examineTopicRouteInfo(DefaultMQAdminExt.java:251) ~[rocketmq-connect-jdbc-0.0.1-SNAPSHOT-jar-with-dependencies.jar:na]
        at org.apache.rocketmq.connect.jdbc.common.Utils.examineBrokerData(Utils.java:63) ~[rocketmq-connect-jdbc-0.0.1-SNAPSHOT-jar-with-dependencies.jar:na]
        at org.apache.rocketmq.connect.jdbc.connector.JdbcSinkConnector.buildRoute(JdbcSinkConnector.java:146) ~[rocketmq-connect-jdbc-0.0.1-SNAPSHOT-jar-with-dependencies.jar:na]
        at org.apache.rocketmq.connect.jdbc.connector.JdbcSinkConnector$1.run(JdbcSinkConnector.java:103) [rocketmq-connect-jdbc-0.0.1-SNAPSHOT-jar-with-dependencies.jar:na]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_242]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_242]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_242]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_242]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_242]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_242]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_242]

POSSIBLE ENHANCEMENT/FEATURE REQUEST

imaffe commented 4 years ago

I can help with the "fetch topic list error" problem, feels like it would help me understand the codebase better :)