yu199195 commented on code in PR #5944:
URL: https://github.com/apache/shenyu/pull/5944#discussion_r1972913691


##########
shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/main/java/org/apache/shenyu/client/apache/dubbo/ApacheDubboServiceBeanListener.java:
##########
@@ -233,16 +235,19 @@ private String buildRpcExt(final ServiceBean<?> 
serviceBean, final String method
                 .url("")
                 .serialization(serviceBean.getSerialization())
                 .build();
-        // set method config: loadbalance,retries,timeout,sent
-        
Optional.ofNullable(serviceBean.getMethods()).orElse(Collections.emptyList()).stream()
-                .filter(m -> methodName.equals(m.getName()))
-                .findFirst()
-                .ifPresent(methodConfig -> {
-                    
Optional.ofNullable(methodConfig.getLoadbalance()).filter(StringUtils::isNotEmpty).ifPresent(build::setLoadbalance);
-                    
Optional.ofNullable(methodConfig.getRetries()).ifPresent(build::setRetries);
-                    
Optional.ofNullable(methodConfig.getTimeout()).ifPresent(build::setTimeout);
-                    
Optional.ofNullable(methodConfig.getSent()).ifPresent(build::setSent);
-                });
+        // method config: loadbalance,retries,timeout,sent
+        if (Objects.nonNull(serviceBean.getMethods())) {
+            build.setMethods(new ArrayList<>());
+            for (MethodConfig methodConfig : serviceBean.getMethods()) {
+                DubboRpcMethodExt methodExt = new DubboRpcMethodExt();
+                methodExt.setName(methodConfig.getName());
+                methodExt.setLoadbalance(methodConfig.getLoadbalance());

Review Comment:
   is not be null?



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

Reply via email to