You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "chengxunhuang (via GitHub)" <gi...@apache.org> on 2023/05/23 03:19:18 UTC

[GitHub] [shardingsphere] chengxunhuang opened a new issue, #25859: In the protocol frontend module of sharding proxy, if you want to add a new database type, you need to use the Java SPI mechanism to add the fully qualified name loaded in the meta-inf.services of the new module. Why can't Java scan it?

chengxunhuang opened a new issue, #25859:
URL: https://github.com/apache/shardingsphere/issues/25859

   ## In the protocol frontend module of sharding proxy, if you want to add a new database type, you need to use the Java SPI mechanism to add the fully qualified name loaded in the meta-inf.services of the new module. Why can't Java scan it?
   
   A module similar to MySQL has been added to the protocol frontend module in sharding proxy, and a fully qualified name for implementing DatabaseProtocolFrontendEngine has also been added under meta-inf.services
   
   However, there is no new database type added in all classes that implement the DatabaseProtocolFrontendEngine interface using Java SPI
   
   ![Snipaste_2023-05-23_11-18-03](https://github.com/apache/shardingsphere/assets/56817751/74c40a6f-6363-4de5-ab63-04e56ea90bd2)
   


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

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


[GitHub] [shardingsphere] sandynz commented on issue #25859: In the protocol frontend module of sharding proxy, if you want to add a new database type, you need to use the Java SPI mechanism to add the fully qualified name loaded in the meta-inf.services of the new module. Why can't Java scan it?

Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz commented on issue #25859:
URL: https://github.com/apache/shardingsphere/issues/25859#issuecomment-1562134071

   Welcome.
   
   I'll close it now since it's clarified.


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


[GitHub] [shardingsphere] chengxunhuang commented on issue #25859: In the protocol frontend module of sharding proxy, if you want to add a new database type, you need to use the Java SPI mechanism to add the fully qualified name loaded in the meta-inf.services of the new module. Why can't Java scan it?

Posted by "chengxunhuang (via GitHub)" <gi...@apache.org>.
chengxunhuang commented on issue #25859:
URL: https://github.com/apache/shardingsphere/issues/25859#issuecomment-1558453622

   Version is 5.3.1


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


[GitHub] [shardingsphere] chengxunhuang commented on issue #25859: In the protocol frontend module of sharding proxy, if you want to add a new database type, you need to use the Java SPI mechanism to add the fully qualified name loaded in the meta-inf.services of the new module. Why can't Java scan it?

Posted by "chengxunhuang (via GitHub)" <gi...@apache.org>.
chengxunhuang commented on issue #25859:
URL: https://github.com/apache/shardingsphere/issues/25859#issuecomment-1560518250

   > 你好@chengxunhuang, ShardingSphere SPI机制使用`java.util.ServiceLoader`标准加载SPI,是Java方式之一。 您想如何通过 Java 加载 SPI impl?
   
   Yes, a database type has been added, with reference to settings similar to MySQL SPI. For example, in the newly added module, the implementation class of the meta-info.services defined interface has not been loaded. If this module is packaged and placed under MySQL, it can be loaded into
   
   


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


[GitHub] [shardingsphere] sandynz commented on issue #25859: In the protocol frontend module of sharding proxy, if you want to add a new database type, you need to use the Java SPI mechanism to add the fully qualified name loaded in the meta-inf.services of the new module. Why can't Java scan it?

Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz commented on issue #25859:
URL: https://github.com/apache/shardingsphere/issues/25859#issuecomment-1559166350

   Hi @chengxunhuang , ShardingSphere SPI mechainism use `java.util.ServiceLoader` standard to load SPI, it's one of the Java way.
   How you want to load SPI impl by Java?
   


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


[GitHub] [shardingsphere] lyzxka commented on issue #25859: In the protocol frontend module of sharding proxy, if you want to add a new database type, you need to use the Java SPI mechanism to add the fully qualified name loaded in the meta-inf.services of the new module. Why can't Java scan it?

Posted by "lyzxka (via GitHub)" <gi...@apache.org>.
lyzxka commented on issue #25859:
URL: https://github.com/apache/shardingsphere/issues/25859#issuecomment-1561350714

   > Hi @lyzxka , when you start debugging, are you sure the new SPI impl module is loaded? Since `java.util.ServiceLoader` just load SPI impl which is in classpath.
   > 
   > If the new module is not depended by any module, I think IDEA won't load the new module classes when you run `org.apache.shardingsphere.proxy.Bootstrap`.
   Yes, I missed that. thank you.
   


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


[GitHub] [shardingsphere] chengxunhuang commented on issue #25859: In the protocol frontend module of sharding proxy, if you want to add a new database type, you need to use the Java SPI mechanism to add the fully qualified name loaded in the meta-inf.services of the new module. Why can't Java scan it?

Posted by "chengxunhuang (via GitHub)" <gi...@apache.org>.
chengxunhuang commented on issue #25859:
URL: https://github.com/apache/shardingsphere/issues/25859#issuecomment-1562122866

   @lyzxka I haven't turned the corner, thank you very much


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


[GitHub] [shardingsphere] chengxunhuang commented on issue #25859: In the protocol frontend module of sharding proxy, if you want to add a new database type, you need to use the Java SPI mechanism to add the fully qualified name loaded in the meta-inf.services of the new module. Why can't Java scan it?

Posted by "chengxunhuang (via GitHub)" <gi...@apache.org>.
chengxunhuang commented on issue #25859:
URL: https://github.com/apache/shardingsphere/issues/25859#issuecomment-1560518769

   > Hi @chengxunhuang , ShardingSphere SPI mechainism use `java.util.ServiceLoader` standard to load SPI, it's one of the Java way. How you want to load SPI impl by Java?
   
   Yes, a database type has been added, with reference to settings similar to MySQL SPI. For example, in the newly added module, the implementation class of the meta-info.services defined interface has not been loaded. If this module is packaged and placed under MySQL, it can be loaded into


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


[GitHub] [shardingsphere] sandynz closed issue #25859: In the protocol frontend module of sharding proxy, if you want to add a new database type, you need to use the Java SPI mechanism to add the fully qualified name loaded in the meta-inf.services of the new module. Why can't Java scan it?

Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz closed issue #25859: In the protocol frontend module of sharding proxy, if you want to add a new database type, you need to use the Java SPI mechanism to add the fully qualified name loaded in the meta-inf.services of the new module. Why can't Java scan it?
URL: https://github.com/apache/shardingsphere/issues/25859


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


[GitHub] [shardingsphere] lyzxka commented on issue #25859: In the protocol frontend module of sharding proxy, if you want to add a new database type, you need to use the Java SPI mechanism to add the fully qualified name loaded in the meta-inf.services of the new module. Why can't Java scan it?

Posted by "lyzxka (via GitHub)" <gi...@apache.org>.
lyzxka commented on issue #25859:
URL: https://github.com/apache/shardingsphere/issues/25859#issuecomment-1560829681

   > Hi @chengxunhuang , ShardingSphere SPI mechainism use `java.util.ServiceLoader` standard to load SPI, it's one of the Java way. How you want to load SPI impl by Java?
   
   Hi @sandynz ,I think the issue asked is: the newly added module with reference to settings similar to MySQL SPI, but SPI is not working.
   I have the same issue. I found that the newly added module are not built. The newly added module is not built until it is referenced by other modules, and SPI works


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


[GitHub] [shardingsphere] chengxunhuang commented on issue #25859: In the protocol frontend module of sharding proxy, if you want to add a new database type, you need to use the Java SPI mechanism to add the fully qualified name loaded in the meta-inf.services of the new module. Why can't Java scan it?

Posted by "chengxunhuang (via GitHub)" <gi...@apache.org>.
chengxunhuang commented on issue #25859:
URL: https://github.com/apache/shardingsphere/issues/25859#issuecomment-1560517952

   Yes, a database type has been added, with reference to settings similar to MySQL SPI. For example, in the newly added module, the implementation class of the meta-info.services defined interface has not been loaded. If this module is packaged and placed under MySQL, it can be loaded into


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


[GitHub] [shardingsphere] sandynz commented on issue #25859: In the protocol frontend module of sharding proxy, if you want to add a new database type, you need to use the Java SPI mechanism to add the fully qualified name loaded in the meta-inf.services of the new module. Why can't Java scan it?

Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz commented on issue #25859:
URL: https://github.com/apache/shardingsphere/issues/25859#issuecomment-1561048382

   Hi @lyzxka , when you start debugging, are you sure the new SPI impl module is loaded? Since `java.util.ServiceLoader` just load SPI impl which is in classpath.
   
   If the new module is not depended by any module, I think IDEA won't load the new module classes when you run `org.apache.shardingsphere.proxy.Bootstrap`.
   


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