File tree Expand file tree Collapse file tree 5 files changed +43
-2
lines changed
config-server/src/main/resources
java/com/coderqian/eurekacustomer/controller
feign-server/src/main/java/com/coderqian/feginserver/configuration Expand file tree Collapse file tree 5 files changed +43
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,6 @@ server.port=1201
33
44spring.cloud.config.server.git.uri =https://github.com/coderqianlq/spring-cloud/
55spring.cloud.config.server.git.search-paths =config-coderqian
6- spring.cloud.config.server.git.username =1242202279@qq.com
7- spring.cloud.config.server.git.password =qlq1995/
6+ spring.cloud.config.server.git.username =
7+ spring.cloud.config.server.git.password =
88
Original file line number Diff line number Diff line change 6868 <artifactId >spring-cloud-starter-config</artifactId >
6969 </dependency >
7070
71+
72+ <dependency >
73+ <groupId >org.springframework.cloud</groupId >
74+ <artifactId >spring-cloud-starter-bus-amqp</artifactId >
75+ </dependency >
76+
77+ <dependency >
78+ <groupId >org.springframework.boot</groupId >
79+ <artifactId >spring-boot-starter-actuator</artifactId >
80+ </dependency >
81+
82+ <dependency >
83+ <groupId >org.springframework.retry</groupId >
84+ <artifactId >spring-retry</artifactId >
85+ </dependency >
86+
87+ <dependency >
88+ <groupId >org.springframework.boot</groupId >
89+ <artifactId >spring-boot-starter-aop</artifactId >
90+ </dependency >
91+
7192 <!-- 引入Mybatis依赖 -->
7293 <dependency >
7394 <groupId >org.mybatis.spring.boot</groupId >
Original file line number Diff line number Diff line change 66import io .swagger .annotations .ApiOperation ;
77import org .springframework .beans .factory .annotation .Autowired ;
88import org .springframework .beans .factory .annotation .Value ;
9+ import org .springframework .cloud .context .config .annotation .RefreshScope ;
910import org .springframework .web .bind .annotation .RequestMapping ;
1011import org .springframework .web .bind .annotation .RequestMethod ;
1112import org .springframework .web .bind .annotation .RequestParam ;
1920 * 测试类
2021 */
2122
23+ @ RefreshScope
2224@ RestController
2325@ RequestMapping (value = "/test" )
2426@ Api (value = "测试" , description = "测试模块" , position = 1 )
2527public class TestController {
2628
29+ @ Value ("${profile}" )
30+ private String profile ;
31+
2732 @ Autowired
2833 private TestService testService ;
2934
@@ -50,4 +55,10 @@ public BaseResult testBaseResult(@RequestParam(value = "text") String text) {
5055 public BaseResult testMybatis (@ RequestParam ("id" ) String id ) {
5156 return testService .testMybatis (id );
5257 }
58+
59+ @ ApiOperation (value = "测试消息总线" , notes = "测试消息总线" )
60+ @ RequestMapping (value = "/bus" , method = RequestMethod .GET )
61+ public String testBus () {
62+ return profile ;
63+ }
5364}
Original file line number Diff line number Diff line change @@ -5,3 +5,10 @@ spring.cloud.config.profile=master
55spring.cloud.config.label =
66spring.cloud.config.uri =http://127.0.0.1:1201/
77
8+ spring.rabbitmq.host =127.0.0.1
9+ spring.rabbitmq.port =5672
10+ spring.rabbitmq.username =guest
11+ spring.rabbitmq.password =guest
12+ management.security.enabled =false
13+
14+ # management.endpoints.web.exposure.include=bus-refresh
Original file line number Diff line number Diff line change 44import feign .Feign ;
55import feign .hystrix .HystrixFeign ;
66import org .springframework .boot .autoconfigure .condition .ConditionalOnClass ;
7+ import org .springframework .boot .autoconfigure .condition .ConditionalOnMissingBean ;
78import org .springframework .boot .autoconfigure .condition .ConditionalOnProperty ;
89import org .springframework .context .annotation .Bean ;
910import org .springframework .context .annotation .Configuration ;
@@ -21,6 +22,7 @@ public class FeignServerConfiguration {
2122
2223 @ Bean
2324 @ Scope ("prototype" )
25+ @ ConditionalOnMissingBean
2426 @ ConditionalOnProperty (name = "feign.hystrix.enabled" , matchIfMissing = true )
2527 public Feign .Builder feignBuilder () {
2628 return Feign .builder ();
You can’t perform that action at this time.
0 commit comments