springcloud21---Config-bus????????????????????????
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了springcloud21---Config-bus????????????????????????相关的知识,希望对你有一定的参考价值。
?????????ping oca frame rpc ?????? ?????? tar java bind
Pivotal??????????????????VMware???EMC?????????.
RabbitMQ??????ERlang???????????????????????????????????????????????????????????????RabbitMQ????????????ERlang???
package com.itmuch.cloud; import org.springframework.beans.factory.annotation.Value; import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController //?????????????????????config server????????????config client????????? @RefreshScope //?????????????????????????????????????????????????????????????????????bean??? //???????????????????????????config client??????????????????????????????config server?????????????????? public class ConfigClientController { @Value("${profile}") private String profile; @GetMapping("/profile") public String getProfile() { return this.profile; } }
package com.itmuch.cloud; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class ConfigServerApplication { public static void main(String[] args) { SpringApplication.run(ConfigServerApplication.class, args); } }
application.yml
server: port: 8082
bootstrap.yml
spring: cloud: config: #config server????????? uri: http://localhost:8080 profile: dev label: master # ???configserver??????????????????Git??????????????????master bus: trace: enabled: true application: name: foobar #??????rabbitmq rabbitmq: host: localhost port: 5672 username: guest password: guest
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.itmuch.cloud</groupId> <artifactId>microservice-spring-cloud</artifactId> <version>0.0.1-SNAPSHOT</version> </parent> <artifactId>microservice-config-client-refresh</artifactId> <packaging>jar</packaging> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-config</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <!-- ??????????????????????????? --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-bus-amqp</artifactId> </dependency> </dependencies> </project>
????????????????????????????????????????????????TCC????????????????????????????????????????????????????????????Eureka,zk,consul,etcd?????????????????????????????????????????????????????????????????????docker??????????????????????????????????????????java -jar????????????????????????????????????
????????????????????????????????????????????????
???????????????????????????http??????rpc???????????????SOAP?????????????????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
nanoservices?????????????????????????????????????????????
Sidecar : ?????????
以上是关于springcloud21---Config-bus????????????????????????的主要内容,如果未能解决你的问题,请参考以下文章
SpringCloud系列SpringCloud概述及微服务技术栈的使用