You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "EarthChen (via GitHub)" <gi...@apache.org> on 2023/04/27 02:16:12 UTC

[GitHub] [dubbo] EarthChen commented on a diff in pull request #12199: packable method extension

EarthChen commented on code in PR #12199:
URL: https://github.com/apache/dubbo/pull/12199#discussion_r1178556881


##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/TripleInvoker.java:
##########
@@ -260,7 +265,10 @@ RequestMetadata createRequest(MethodDescriptor methodDescriptor, Invocation invo
         if (methodDescriptor instanceof PackableMethod) {
             meta.packableMethod = (PackableMethod) methodDescriptor;
         } else {
-            meta.packableMethod = ReflectionPackableMethod.init(methodDescriptor, url);
+            final String contentType = APPLICATION_GRPC + "+" + UrlUtils.serializationOrDefault(url);

Review Comment:
   Do not dynamically concatenate content types for now



##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/ReflectionAbstractServerCall.java:
##########
@@ -185,7 +191,10 @@ private void trySetMethodDescriptor(byte[] data) throws IOException {
                     + serviceDescriptor.getInterfaceName()), null);
             return;
         }
-        packableMethod = ReflectionPackableMethod.init(methodDescriptor, invoker.getUrl());
+        final URL url = invoker.getUrl();
+        packableMethod = frameworkModel.getExtensionLoader(PackableMethodFactory.class)
+            .getExtension(ConfigurationUtils.getGlobalConfiguration(frameworkModel.defaultApplication()).getString(DUBBO_PACKABLE_METHOD_FACTORY, DEFAULT_KEY))

Review Comment:
   same



##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/ReflectionAbstractServerCall.java:
##########
@@ -116,7 +120,10 @@ public void startCall() {
             }
         }
         if (methodDescriptor != null) {
-            packableMethod = ReflectionPackableMethod.init(methodDescriptor, invoker.getUrl());
+            final URL url = invoker.getUrl();
+            packableMethod = frameworkModel.getExtensionLoader(PackableMethodFactory.class)
+                .getExtension(ConfigurationUtils.getGlobalConfiguration(frameworkModel.defaultApplication()).getString(DUBBO_PACKABLE_METHOD_FACTORY, DEFAULT_KEY))

Review Comment:
   If it's an app model, it's still going to be in the url



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

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


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