File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
spring-boot-starter-dubbo/src/main/java/org/mvnsearch/spring/boot/dubbo Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 10
10
import org .springframework .boot .context .properties .EnableConfigurationProperties ;
11
11
import org .springframework .context .annotation .Bean ;
12
12
import org .springframework .context .annotation .Configuration ;
13
+ import org .springframework .core .env .Environment ;
13
14
14
15
/**
15
16
* dubbo auto configuration
@@ -22,11 +23,16 @@ public class DubboAutoConfiguration {
22
23
@ SuppressWarnings ("SpringJavaAutowiringInspection" )
23
24
@ Autowired
24
25
private DubboProperties properties ;
26
+ @ Autowired
27
+ private Environment env ;
25
28
26
29
@ Bean
27
30
@ ConditionalOnMissingBean
28
31
public ApplicationConfig dubboApplicationConfig () {
29
32
ApplicationConfig appConfig = new ApplicationConfig ();
33
+ if (properties .getApp () == null || properties .getApp ().isEmpty ()) {
34
+ properties .setApp (env .getProperty ("spring.application.name" ));
35
+ }
30
36
appConfig .setName (properties .getApp ());
31
37
return appConfig ;
32
38
}
You can’t perform that action at this time.
0 commit comments