You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2020/04/02 21:20:35 UTC

[GitHub] [rocketmq-externals] imaffe commented on issue #540: [rocketmq-connect-runtime] possible enhancements recorder

imaffe commented on issue #540: [rocketmq-connect-runtime] possible enhancements recorder
URL: https://github.com/apache/rocketmq-externals/issues/540#issuecomment-608095815
 
 
   We (me and @gripson) found  a bug in jdbc-connector. when creating DruidDataSource
   
   in `DBUtils.java`
   
   ```
   
           Map<String, String> map = new HashMap<>();
           map.put("driverClassName", "com.mysql.cj.jdbc.Driver");
           map.put("url",
                   "jdbc:mysql://" + config.getDbUrl() + ":" + config.getDbPort()  + "?useSSL=false&verifyServerCertificate=false&serverTimezone=GMT%2B8&characterEncoding=utf8");
           map.put("username", config.getDbUsername());
           map.put("password", config.getDbPassword());
           map.put("initialSize", "1");
           map.put("maxActive", "2");
           map.put("maxWait", "60000");
           map.put("timeBetweenEvictionRunsMillis", "60000");
           map.put("minEvictableIdleTimeMillis", "300000");
           map.put("validationQuery", "SELECT 1");
           map.put("testWhileIdle", "true");
           log.info("{} config read successful", map);
           DataSource dataSource = DruidDataSourceFactory.createDataSource(map);
           log.info("created data source");
   
   ...
   ```
   
   Here the datasource creation could fail. We are trying to find out why createDataSource would fail.
   
   My source connector configuration:
   ```
   {
       "connector-class":"org.apache.rocketmq.connect.jdbc.connector.JdbcSourceConnector",
       "rocketmqTopic":"jdbcTopic",
       "dbUrl":"127.0.0.1",
       "dbPort":"3306",
       "dbUsername":"root",
       "dbPassword":"root",
       "whiteDataBase": {
           "jdbc":{
              "person": {"NO-FILTER": "10"}
            }
         },
       "mode": "bulk",
       "task-parallelism": 1,
       "source-cluster": "172.17.0.1:10911",
       "source-rocketmq": "localhost:9876",
       "source-record-converter":"org.apache.rocketmq.connect.runtime.converter.JsonConverter"
    }
   
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services