kerwin612 commented on code in PR #5050:
URL: https://github.com/apache/shenyu/pull/5050#discussion_r1307135848


##########
shenyu-spring-boot-starter/shenyu-spring-boot-starter-client/shenyu-spring-boot-starter-client-springmvc/src/main/java/org/apache/shenyu/springboot/starter/client/springmvc/ShenyuSpringMvcClientConfiguration.java:
##########
@@ -47,12 +53,27 @@ public class ShenyuSpringMvcClientConfiguration {
      *
      * @param clientConfig                   the client config
      * @param shenyuClientRegisterRepository the shenyu client register 
repository
+     * @param env                            the env
      * @return the spring mvc client bean post processor
      */
     @Bean
     @ConditionalOnMissingBean(ClientRegisterConfiguration.class)
     public SpringMvcClientEventListener springHttpClientEventListener(final 
ShenyuClientConfig clientConfig,
-                                                                          
final ShenyuClientRegisterRepository shenyuClientRegisterRepository) {
-        return new 
SpringMvcClientEventListener(clientConfig.getClient().get(RpcTypeEnum.HTTP.getName()),
 shenyuClientRegisterRepository);
+                                                                          
final ShenyuClientRegisterRepository shenyuClientRegisterRepository,
+                                                                          
final Environment env) {
+        ClientPropertiesConfig clientPropertiesConfig = 
clientConfig.getClient().get(RpcTypeEnum.HTTP.getName());
+        Properties props = clientPropertiesConfig == null ? null : 
clientPropertiesConfig.getProps();
+        String applicationName = env.getProperty("spring.application.name");
+        if (props != null) {
+            String appName = props.getProperty(ShenyuClientConstants.APP_NAME);
+            if (StringUtils.isBlank(appName)) {
+                props.setProperty(ShenyuClientConstants.APP_NAME, 
applicationName);

Review Comment:
   `shenyu.register.props.xxx: ${another_property:}`  
   This problem can occur when referencing the value of another property;  
   After all, the real scene was always strange and varied.



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