oxsean commented on code in PR #14077:
URL: https://github.com/apache/dubbo/pull/14077#discussion_r1604294327


##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/TripleHttp2Protocol.java:
##########
@@ -204,10 +205,9 @@ private Http2FrameCodec buildHttp2FrameCodec(URL url) {
     }
 
     private TripleConfig getTripleConfig(URL url) {
-        return url.getOrDefaultApplicationModel()
-                .getApplicationConfigManager()
-                .getProtocol(url.getProtocol())
-                .orElseThrow(() -> new IllegalStateException("There's no 
ProtocolConfig specified."))
-                .getTriple();
+        return 
url.getOrDefaultApplicationModel().getApplicationConfigManager().getDefaultProtocols().stream()

Review Comment:
   getApplicationConfigManager().getProtocol(url.getProtocol())?
   Using findFirst is not reasonable. What if the first one is the Dubbo 
protocol? Also, if nothing is found, it should throw an exception; otherwise, 
how would the initial values be initialized?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to