You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "funky-eyes (via GitHub)" <gi...@apache.org> on 2024/03/01 10:12:50 UTC

Re: [PR] feature: support `native-image` for `seata-client` [incubator-seata]

funky-eyes commented on code in PR #5476:
URL: https://github.com/apache/incubator-seata/pull/5476#discussion_r1508776693


##########
config/seata-config-core/src/main/java/io/seata/config/ConfigurationCache.java:
##########
@@ -101,8 +100,8 @@ public void onChangeEvent(ConfigurationChangeEvent event) {
     }
 
     public Configuration proxy(Configuration originalConfiguration) throws Exception {
-        return new ByteBuddy().subclass(Configuration.class).method(ElementMatchers.any())
-            .intercept(InvocationHandlerAdapter.of((proxy, method, args) -> {
+        return (Configuration)Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[]{Configuration.class}
+            , (proxy, method, args) -> {

Review Comment:
   > * @funky-eyes
   > * As a solution to [No classes have been predefined during the image build to load from bytecodes at runtime raphw/byte-buddy#1588](https://github.com/raphw/byte-buddy/issues/1588) , can we port the handling of `ConfigurationCache.java` back to the 2.x branch?
   > * Reference https://github.com/apache/incubator-seata/blob/2.x/config/seata-config-core/src/main/java/org/apache/seata/config/ConfigurationCache.java .
   
   https://github.com/apache/incubator-seata/pull/6386  configurationcache will remove bytebuddy proxy in this pr



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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org