You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "sandynz (via GitHub)" <gi...@apache.org> on 2023/02/20 02:57:44 UTC

[GitHub] [shardingsphere] sandynz commented on a diff in pull request #24218: Remove CDC rule, move CDC config into server properties

sandynz commented on code in PR #24218:
URL: https://github.com/apache/shardingsphere/pull/24218#discussion_r1111407763


##########
proxy/bootstrap/src/main/java/org/apache/shardingsphere/proxy/Bootstrap.java:
##########
@@ -51,10 +52,8 @@ public static void main(final String[] args) throws IOException, SQLException {
         int port = bootstrapArgs.getPort().orElseGet(() -> new ConfigurationProperties(yamlConfig.getServerConfiguration().getProps()).getValue(ConfigurationPropertyKey.PROXY_DEFAULT_PORT));
         List<String> addresses = bootstrapArgs.getAddresses();
         new BootstrapInitializer().init(yamlConfig, port, bootstrapArgs.getForce());
-        boolean cdcEnabled = null != yamlConfig.getServerConfiguration().getCdc() && yamlConfig.getServerConfiguration().getCdc().isEnabled();
-        if (cdcEnabled) {
-            new CDCServer(addresses, yamlConfig.getServerConfiguration().getCdc().getPort()).start();
-        }
+        Optional.ofNullable((Integer) yamlConfig.getServerConfiguration().getProps().get(ConfigurationPropertyKey.CDC_SERVER_PORT.getKey()))
+                .ifPresent(cdcPort -> new CDCServer(addresses, cdcPort).start());

Review Comment:
   Will start CDC server throw exception? If true, then it might need to catch and ignore it



##########
infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java:
##########
@@ -122,7 +122,12 @@ public enum ConfigurationPropertyKey implements TypedPropertyKey {
     /**
      * Proxy instance type.
      */
-    PROXY_INSTANCE_TYPE("proxy-instance-type", "Proxy", String.class, true);
+    PROXY_INSTANCE_TYPE("proxy-instance-type", "Proxy", String.class, true),
+    
+    /**
+     * CDC server port.
+     */
+    CDC_SERVER_PORT("cdc-server-port", "33071", int.class, true);
     

Review Comment:
   Currently, reboot is required after `cdc-server-port` changed, it might be not required later



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org