spring cloud简介

spring cloud 为开发人员提供了快速构建分布式系统的一些工具,包括配置管理、服务发现、断路器、路由、微代理、事件总线、全局锁、决策竞选、分布式会话等等。它运行环境简单,可以在开发人员的电脑上跑。另外说明spring cloud是基于springboot的,所以需要开发中对springboot有一定的了解,如果不了解的话可以看这篇文章:2小时学会springboot。另外对于“微服务架构” 不了解的话,可以通过搜索引擎搜索“微服务架构”了解下。

在之前的所有Spring Boot相关博文中,都会涉及Spring Boot工程的创建。而创建的方式多种多样,这里,我们可以通过Maven来手工构建或是通过脚手架等方式快速搭建。

本文我们将介绍嵌入的Intellij中的maven工具,来快速的构建出一个基础的Spring Cloud工程。

创建工程

第一步: 菜单栏中选择File=>New=>Project..,我们可以看到如下图所示的创建功能窗口。然后,我们选择maven

图片.png

图片.png

第二步: 点击Next,等待片刻后,我们可以看到如下图所示的工程信息窗口,在这里我们可以编辑我们想要创建的工程信息。其中,GroupId是工程的分组id,ArtifactId是模块分组id,Version是当前的版本。GroupIdArtifactIdVersion组合在一起形成一个模块的坐标

图片.png

第三步: 点击Next,进入最后关于工程物理存储的一些细节。最后,点击Finish就能完成工程的构建了。

图片.png

工程构建完成

图片.png

加入pom坐标

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5. <modelVersion>4.0.0</modelVersion>
  6. <parent>
  7. <groupId>cn.zhangbox</groupId>
  8. <artifactId>spring-cloud-study</artifactId>
  9. <version>1.0-SNAPSHOT</version>
  10. </parent>
  11. <groupId>cn.zhangbox.cloud.demo</groupId>
  12. <artifactId>cloud-demo</artifactId>
  13. <version>1.0-SNAPSHOT</version>
  14. <properties>
  15. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  16. <java.version>1.8</java.version>
  17. </properties>
  18. <dependencies>
  19. <!-- 添加eureka支持start -->
  20. <dependency>
  21. <groupId>org.springframework.cloud</groupId>
  22. <artifactId>spring-cloud-starter-eureka</artifactId>
  23. </dependency>
  24. <!-- 添加eureka支持start -->
  25. <!-- 添加web支持start -->
  26. <dependency>
  27. <groupId>org.springframework.boot</groupId>
  28. <artifactId>spring-boot-starter-web</artifactId>
  29. </dependency>
  30. <!-- 添加web支持end -->
  31. </dependencies>
  32. <!-- 添加cloud 依赖start -->
  33. <dependencyManagement>
  34. <dependencies>
  35. <dependency>
  36. <groupId>org.springframework.cloud</groupId>
  37. <artifactId>spring-cloud-dependencies</artifactId>
  38. <version>Dalston.SR1</version>
  39. <type>pom</type>
  40. <scope>import</scope>
  41. </dependency>
  42. </dependencies>
  43. </dependencyManagement>
  44. <!-- 添加cloud 依赖end -->
  45. <!-- 添加maven构建插件start -->
  46. <build>
  47. <plugins>
  48. <plugin>
  49. <groupId>org.springframework.boot</groupId>
  50. <artifactId>spring-boot-maven-plugin</artifactId>
  51. </plugin>
  52. </plugins>
  53. </build>
  54. <!-- 添加maven构建插件end -->
  55. </project>

修改YML配置

  1. #工程名称
  2. spring:
  3. application:
  4. name: cloud-demo
  5. #选择哪一个环境的配置
  6. #这里可以在每个环境配置redis,数据库(mysql),消息(kafka)等相关的组件的配置
  7. profiles:
  8. active: dev
  9. #配置eureka获取服务地址,这里使用的是程序员DD公开的eureka注册中心,感谢程序员DD提供的注册中心
  10. eureka:
  11. client:
  12. serviceUrl:
  13. defaultZone: http://eureka.didispace.com/eureka/
  14. #文档块区分为三个---
  15. ---
  16. server:
  17. port: 8081
  18. spring:
  19. profiles: dev
  20. #日志
  21. logging:
  22. config: classpath:log/logback.xml
  23. path: log/cloud-demo
  24. #文档块区分为三个---
  25. ---
  26. server:
  27. port: 8082
  28. spring:
  29. profiles: test
  30. #日志
  31. logging:
  32. config: classpath:log/logback.xml
  33. path: usr/cloud-demo/log/cloud-demo
  34. #文档块区分为三个---
  35. ---
  36. server:
  37. port: 8083
  38. spring:
  39. profiles: prod
  40. #日志
  41. logging:
  42. config: classpath:log/logback.xml
  43. path: usr/cloud-demo/log/cloud-demo

创建日志配置文件

在工程resources文件夹下新建文件夹log,并在该文件夹下创建logback.xml文件,加入以下配置:

  1. <!-- Logback configuration. See http://logback.qos.ch/manual/index.html -->
  2. <configuration scan="true" scanPeriod="10 seconds">
  3. <!--继承spring boot提供的logback配置-->
  4. <!--<include resource="org/springframework/boot/logging/logback/base.xml" />-->
  5. <!--设置系统日志目录-->
  6. <property name="APP_DIR" value="cloud-demo" />
  7. <!-- 彩色日志 -->
  8. <!-- 彩色日志依赖的渲染类 -->
  9. <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
  10. <conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
  11. <conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
  12. <!-- 彩色日志格式 -->
  13. <property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
  14. <!-- 控制台输出 -->
  15. <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
  16. <encoder>
  17. <Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
  18. <charset>UTF-8</charset> <!-- 此处设置字符集 -->
  19. </encoder>
  20. <!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
  21. <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
  22. <level>debug</level>
  23. </filter>
  24. </appender>
  25. <!-- 时间滚动输出 level为 DEBUG 日志 -->
  26. <appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
  27. <!-- 正在记录的日志文件的路径及文件名 -->
  28. <file>${LOG_PATH}/log_debug.log</file>
  29. <!--日志文件输出格式-->
  30. <encoder>
  31. <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
  32. <charset>UTF-8</charset> <!-- 此处设置字符集 -->
  33. </encoder>
  34. <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
  35. <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  36. <!--
  37. 归档的日志文件的路径,例如今天是2017-04-26日志,当前写的日志文件路径为file节点指定,可以将此文件与file指定文件路径设置为不同路径,从而将当前日志文件或归档日志文件置不同的目录。
  38. 而2017-04-26的日志文件在由fileNamePattern指定。%d{yyyy-MM-dd}指定日期格式,%i指定索引
  39. -->
  40. <fileNamePattern>${LOG_PATH}/debug/log-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
  41. <!--
  42. 除按日志记录之外,还配置了日志文件不能超过500M,若超过500M,日志文件会以索引0开始,
  43. 命名日志文件,例如log-error-2017-04-26.0.log
  44. -->
  45. <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  46. <maxFileSize>500MB</maxFileSize>
  47. </timeBasedFileNamingAndTriggeringPolicy>
  48. <!--日志文件保留天数-->
  49. <maxHistory>30</maxHistory>
  50. </rollingPolicy>
  51. <!-- 此日志文件只记录debug级别的 -->
  52. <filter class="ch.qos.logback.classic.filter.LevelFilter">
  53. <level>debug</level>
  54. <onMatch>ACCEPT</onMatch>
  55. <onMismatch>DENY</onMismatch>
  56. </filter>
  57. </appender>
  58. <!-- 时间滚动输出 level为 INFO 日志 -->
  59. <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
  60. <!-- 正在记录的日志文件的路径及文件名 -->
  61. <file>${LOG_PATH}/log_info.log</file>
  62. <!--日志文件输出格式-->
  63. <encoder>
  64. <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
  65. <charset>UTF-8</charset> <!-- 此处设置字符集 -->
  66. </encoder>
  67. <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
  68. <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  69. <!--
  70. 归档的日志文件的路径,例如今天是2017-04-26日志,当前写的日志文件路径为file节点指定,可以将此文件与file指定文件路径设置为不同路径,从而将当前日志文件或归档日志文件置不同的目录。
  71. 而2017-04-26的日志文件在由fileNamePattern指定。%d{yyyy-MM-dd}指定日期格式,%i指定索引
  72. -->
  73. <fileNamePattern>${LOG_PATH}/info/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
  74. <!--
  75. 除按日志记录之外,还配置了日志文件不能超过500M,若超过500M,日志文件会以索引0开始,
  76. 命名日志文件,例如log-error-2017-04-26.0.log
  77. -->
  78. <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  79. <maxFileSize>500MB</maxFileSize>
  80. </timeBasedFileNamingAndTriggeringPolicy>
  81. <!--日志文件保留天数-->
  82. <maxHistory>30</maxHistory>
  83. </rollingPolicy>
  84. <!-- 此日志文件只记录info级别的 -->
  85. <filter class="ch.qos.logback.classic.filter.LevelFilter">
  86. <level>info</level>
  87. <onMatch>ACCEPT</onMatch>
  88. <onMismatch>DENY</onMismatch>
  89. </filter>
  90. </appender>
  91. <!-- 时间滚动输出 level为 WARN 日志 -->
  92. <appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
  93. <!-- 正在记录的日志文件的路径及文件名 -->
  94. <file>${LOG_PATH}/log_warn.log</file>
  95. <!--日志文件输出格式-->
  96. <encoder>
  97. <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
  98. <charset>UTF-8</charset> <!-- 此处设置字符集 -->
  99. </encoder>
  100. <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
  101. <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  102. <!--
  103. 归档的日志文件的路径,例如今天是2017-04-26日志,当前写的日志文件路径为file节点指定,可以将此文件与file指定文件路径设置为不同路径,从而将当前日志文件或归档日志文件置不同的目录。
  104. 而2017-04-26的日志文件在由fileNamePattern指定。%d{yyyy-MM-dd}指定日期格式,%i指定索引
  105. -->
  106. <fileNamePattern>${LOG_PATH}/warn/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
  107. <!--
  108. 除按日志记录之外,还配置了日志文件不能超过500M,若超过500M,日志文件会以索引0开始,
  109. 命名日志文件,例如log-error-2017-04-26.0.log
  110. -->
  111. <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  112. <maxFileSize>500MB</maxFileSize>
  113. </timeBasedFileNamingAndTriggeringPolicy>
  114. <!--日志文件保留天数-->
  115. <maxHistory>30</maxHistory>
  116. </rollingPolicy>
  117. <!-- 此日志文件只记录warn级别的 -->
  118. <filter class="ch.qos.logback.classic.filter.LevelFilter">
  119. <level>warn</level>
  120. <onMatch>ACCEPT</onMatch>
  121. <onMismatch>DENY</onMismatch>
  122. </filter>
  123. </appender>
  124. <!-- 时间滚动输出 level为 ERROR 日志 -->
  125. <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
  126. <!-- 正在记录的日志文件的路径及文件名 -->
  127. <file>${LOG_PATH}/log_error.log</file>
  128. <!--日志文件输出格式-->
  129. <encoder>
  130. <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
  131. <charset>UTF-8</charset> <!-- 此处设置字符集 -->
  132. </encoder>
  133. <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
  134. <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  135. <!--
  136. 归档的日志文件的路径,例如今天是2017-04-26日志,当前写的日志文件路径为file节点指定,可以将此文件与file指定文件路径设置为不同路径,从而将当前日志文件或归档日志文件置不同的目录。
  137. 而2017-04-26的日志文件在由fileNamePattern指定。%d{yyyy-MM-dd}指定日期格式,%i指定索引
  138. -->
  139. <fileNamePattern>${LOG_PATH}/error/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
  140. <!--
  141. 除按日志记录之外,还配置了日志文件不能超过500M,若超过500M,日志文件会以索引0开始,
  142. 命名日志文件,例如log-error-2017-04-26.0.log
  143. -->
  144. <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  145. <maxFileSize>500MB</maxFileSize>
  146. </timeBasedFileNamingAndTriggeringPolicy>
  147. <!--日志文件保留天数-->
  148. <maxHistory>30</maxHistory>
  149. </rollingPolicy>
  150. <!-- 此日志文件只记录ERROR级别的 -->
  151. <filter class="ch.qos.logback.classic.filter.LevelFilter">
  152. <level>error</level>
  153. <onMatch>ACCEPT</onMatch>
  154. <onMismatch>DENY</onMismatch>
  155. </filter>
  156. </appender>
  157. <logger name="org.springframework.web" level="info"/>
  158. <logger name="org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor" level="INFO"/>
  159. <logger name="cn.zhangbox.cloud" level="debug"/>
  160. <!--开发环境:打印控制台-->
  161. <springProfile name="dev">
  162. <root level="info">
  163. <appender-ref ref="CONSOLE" />
  164. <appender-ref ref="DEBUG_FILE" />
  165. <appender-ref ref="INFO_FILE" />
  166. <appender-ref ref="WARN_FILE" />
  167. <appender-ref ref="ERROR_FILE" />
  168. </root>
  169. </springProfile>
  170. <!--测试环境:打印控制台和输出到文件-->
  171. <springProfile name="test">
  172. <root level="info">
  173. <appender-ref ref="CONSOLE" />
  174. <appender-ref ref="INFO_FILE" />
  175. <appender-ref ref="WARN_FILE" />
  176. <appender-ref ref="ERROR_FILE" />
  177. </root>
  178. </springProfile>
  179. <!--生产环境:输出到文件-->
  180. <springProfile name="prod">
  181. <root level="error">
  182. <appender-ref ref="CONSOLE" />
  183. <appender-ref ref="DEBUG_FILE" />
  184. <appender-ref ref="INFO_FILE" />
  185. <appender-ref ref="ERROR_FILE" />
  186. </root>
  187. </springProfile>
  188. </configuration>

创建Controller

在工程java代码目录下创建controller的目录在下面创建DcController类用来测试服务是否已经注册到eureka并加入以下代码:

  1. @RestController
  2. public class DcController {
  3. @Autowired
  4. DiscoveryClient discoveryClient;
  5. @GetMapping("/dc")
  6. public String dc() {
  7. String services = "Services: " + discoveryClient.getServices();
  8. System.out.println(services);
  9. return services;
  10. }
  11. }

创建启动类

  1. @EnableDiscoveryClient //使用该注解将注册服务到eureka
  2. @SpringBootApplication
  3. public class SpringCloudDemoApplication {
  4. public static void main(String[] args) {
  5. new SpringApplicationBuilder(
  6. SpringCloudDemoApplication.class).web(true).run(args);
  7. }
  8. }

控制台打印

  1. "C:\Program Files\Java\jdk1.8.0_151\bin\java" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:51282,suspend=y,server=n -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=51281 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_151\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\rt.jar;C:\Users\Administrator\Desktop\manage\spring-cloud-study\cloud-demo\target\classes;D:\开发工具\repository\org\springframework\cloud\spring-cloud-starter-eureka\1.3.1.RELEASE\spring-cloud-starter-eureka-1.3.1.RELEASE.jar;D:\开发工具\repository\org\springframework\cloud\spring-cloud-starter\1.2.2.RELEASE\spring-cloud-starter-1.2.2.RELEASE.jar;D:\开发工具\repository\org\springframework\cloud\spring-cloud-context\1.2.2.RELEASE\spring-cloud-context-1.2.2.RELEASE.jar;D:\开发工具\repository\org\springframework\security\spring-security-crypto\4.2.2.RELEASE\spring-security-crypto-4.2.2.RELEASE.jar;D:\开发工具\repository\org\springframework\cloud\spring-cloud-commons\1.2.2.RELEASE\spring-cloud-commons-1.2.2.RELEASE.jar;D:\开发工具\repository\org\springframework\security\spring-security-rsa\1.0.3.RELEASE\spring-security-rsa-1.0.3.RELEASE.jar;D:\开发工具\repository\org\bouncycastle\bcpkix-jdk15on\1.55\bcpkix-jdk15on-1.55.jar;D:\开发工具\repository\org\bouncycastle\bcprov-jdk15on\1.55\bcprov-jdk15on-1.55.jar;D:\开发工具\repository\org\springframework\cloud\spring-cloud-netflix-core\1.3.1.RELEASE\spring-cloud-netflix-core-1.3.1.RELEASE.jar;D:\开发工具\repository\org\springframework\boot\spring-boot\1.5.3.RELEASE\spring-boot-1.5.3.RELEASE.jar;D:\开发工具\repository\org\springframework\boot\spring-boot-autoconfigure\1.5.3.RELEASE\spring-boot-autoconfigure-1.5.3.RELEASE.jar;D:\开发工具\repository\org\springframework\cloud\spring-cloud-netflix-eureka-client\1.3.1.RELEASE\spring-cloud-netflix-eureka-client-1.3.1.RELEASE.jar;D:\开发工具\repository\com\netflix\eureka\eureka-client\1.6.2\eureka-client-1.6.2.jar;D:\开发工具\repository\org\codehaus\jettison\jettison\1.3.7\jettison-1.3.7.jar;D:\开发工具\repository\stax\stax-api\1.0.1\stax-api-1.0.1.jar;D:\开发工具\repository\com\netflix\netflix-commons\netflix-eventbus\0.3.0\netflix-eventbus-0.3.0.jar;D:\开发工具\repository\com\netflix\netflix-commons\netflix-infix\0.3.0\netflix-infix-0.3.0.jar;D:\开发工具\repository\commons-jxpath\commons-jxpath\1.3\commons-jxpath-1.3.jar;D:\开发工具\repository\joda-time\joda-time\2.9.9\joda-time-2.9.9.jar;D:\开发工具\repository\org\antlr\antlr-runtime\3.4\antlr-runtime-3.4.jar;D:\开发工具\repository\org\antlr\stringtemplate\3.2.1\stringtemplate-3.2.1.jar;D:\开发工具\repository\antlr\antlr\2.7.7\antlr-2.7.7.jar;D:\开发工具\repository\com\google\code\gson\gson\2.8.0\gson-2.8.0.jar;D:\开发工具\repository\org\apache\commons\commons-math\2.2\commons-math-2.2.jar;D:\开发工具\repository\com\netflix\archaius\archaius-core\0.7.4\archaius-core-0.7.4.jar;D:\开发工具\repository\javax\ws\rs\jsr311-api\1.1.1\jsr311-api-1.1.1.jar;D:\开发工具\repository\com\netflix\servo\servo-core\0.10.1\servo-core-0.10.1.jar;D:\开发工具\repository\com\netflix\servo\servo-internal\0.10.1\servo-internal-0.10.1.jar;D:\开发工具\repository\com\sun\jersey\jersey-core\1.19.1\jersey-core-1.19.1.jar;D:\开发工具\repository\com\sun\jersey\jersey-client\1.19.1\jersey-client-1.19.1.jar;D:\开发工具\repository\com\sun\jersey\contribs\jersey-apache-client4\1.19.1\jersey-apache-client4-1.19.1.jar;D:\开发工具\repository\org\apache\httpcomponents\httpclient\4.5.3\httpclient-4.5.3.jar;D:\开发工具\repository\org\apache\httpcomponents\httpcore\4.4.6\httpcore-4.4.6.jar;D:\开发工具\repository\commons-codec\commons-codec\1.10\commons-codec-1.10.jar;D:\开发工具\repository\com\google\inject\guice\4.1.0\guice-4.1.0.jar;D:\开发工具\repository\javax\inject\javax.inject\1\javax.inject-1.jar;D:\开发工具\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;D:\开发工具\repository\com\fasterxml\jackson\core\jackson-annotations\2.8.0\jackson-annotations-2.8.0.jar;D:\开发工具\repository\com\fasterxml\jackson\core\jackson-core\2.8.8\jackson-core-2.8.8.jar;D:\开发工具\repository\com\netflix\eureka\eureka-core\1.6.2\eureka-core-1.6.2.jar;D:\开发工具\repository\org\codehaus\woodstox\woodstox-core-asl\4.4.1\woodstox-core-asl-4.4.1.jar;D:\开发工具\repository\javax\xml\stream\stax-api\1.0-2\stax-api-1.0-2.jar;D:\开发工具\repository\org\codehaus\woodstox\stax2-api\3.1.4\stax2-api-3.1.4.jar;D:\开发工具\repository\org\springframework\cloud\spring-cloud-starter-archaius\1.3.1.RELEASE\spring-cloud-starter-archaius-1.3.1.RELEASE.jar;D:\开发工具\repository\commons-configuration\commons-configuration\1.8\commons-configuration-1.8.jar;D:\开发工具\repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;D:\开发工具\repository\com\google\guava\guava\18.0\guava-18.0.jar;D:\开发工具\repository\org\springframework\cloud\spring-cloud-starter-ribbon\1.3.1.RELEASE\spring-cloud-starter-ribbon-1.3.1.RELEASE.jar;D:\开发工具\repository\com\netflix\ribbon\ribbon\2.2.2\ribbon-2.2.2.jar;D:\开发工具\repository\com\netflix\ribbon\ribbon-transport\2.2.2\ribbon-transport-2.2.2.jar;D:\开发工具\repository\io\reactivex\rxnetty-contexts\0.4.9\rxnetty-contexts-0.4.9.jar;D:\开发工具\repository\io\reactivex\rxnetty-servo\0.4.9\rxnetty-servo-0.4.9.jar;D:\开发工具\repository\com\netflix\hystrix\hystrix-core\1.5.12\hystrix-core-1.5.12.jar;D:\开发工具\repository\org\hdrhistogram\HdrHistogram\2.1.9\HdrHistogram-2.1.9.jar;D:\开发工具\repository\io\reactivex\rxnetty\0.4.9\rxnetty-0.4.9.jar;D:\开发工具\repository\io\netty\netty-codec-http\4.0.27.Final\netty-codec-http-4.0.27.Final.jar;D:\开发工具\repository\io\netty\netty-codec\4.0.27.Final\netty-codec-4.0.27.Final.jar;D:\开发工具\repository\io\netty\netty-handler\4.0.27.Final\netty-handler-4.0.27.Final.jar;D:\开发工具\repository\io\netty\netty-transport-native-epoll\4.0.27.Final\netty-transport-native-epoll-4.0.27.Final.jar;D:\开发工具\repository\io\netty\netty-common\4.0.27.Final\netty-common-4.0.27.Final.jar;D:\开发工具\repository\io\netty\netty-buffer\4.0.27.Final\netty-buffer-4.0.27.Final.jar;D:\开发工具\repository\io\netty\netty-transport\4.0.27.Final\netty-transport-4.0.27.Final.jar;D:\开发工具\repository\com\netflix\ribbon\ribbon-core\2.2.2\ribbon-core-2.2.2.jar;D:\开发工具\repository\com\netflix\ribbon\ribbon-httpclient\2.2.2\ribbon-httpclient-2.2.2.jar;D:\开发工具\repository\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar;D:\开发工具\repository\com\netflix\netflix-commons\netflix-commons-util\0.1.1\netflix-commons-util-0.1.1.jar;D:\开发工具\repository\com\netflix\ribbon\ribbon-loadbalancer\2.2.2\ribbon-loadbalancer-2.2.2.jar;D:\开发工具\repository\com\netflix\netflix-commons\netflix-statistics\0.1.1\netflix-statistics-0.1.1.jar;D:\开发工具\repository\io\reactivex\rxjava\1.1.10\rxjava-1.1.10.jar;D:\开发工具\repository\com\netflix\ribbon\ribbon-eureka\2.2.2\ribbon-eureka-2.2.2.jar;D:\开发工具\repository\org\slf4j\slf4j-api\1.7.25\slf4j-api-1.7.25.jar;D:\开发工具\repository\com\thoughtworks\xstream\xstream\1.4.9\xstream-1.4.9.jar;D:\开发工具\repository\xmlpull\xmlpull\1.1.3.1\xmlpull-1.1.3.1.jar;D:\开发工具\repository\xpp3\xpp3_min\1.1.4c\xpp3_min-1.1.4c.jar;D:\开发工具\repository\org\springframework\boot\spring-boot-starter-web\1.5.3.RELEASE\spring-boot-starter-web-1.5.3.RELEASE.jar;D:\开发工具\repository\org\springframework\boot\spring-boot-starter\1.5.3.RELEASE\spring-boot-starter-1.5.3.RELEASE.jar;D:\开发工具\repository\org\springframework\boot\spring-boot-starter-logging\1.5.3.RELEASE\spring-boot-starter-logging-1.5.3.RELEASE.jar;D:\开发工具\repository\ch\qos\logback\logback-classic\1.1.11\logback-classic-1.1.11.jar;D:\开发工具\repository\ch\qos\logback\logback-core\1.1.11\logback-core-1.1.11.jar;D:\开发工具\repository\org\slf4j\jcl-over-slf4j\1.7.25\jcl-over-slf4j-1.7.25.jar;D:\开发工具\repository\org\slf4j\jul-to-slf4j\1.7.25\jul-to-slf4j-1.7.25.jar;D:\开发工具\repository\org\slf4j\log4j-over-slf4j\1.7.25\log4j-over-slf4j-1.7.25.jar;D:\开发工具\repository\org\springframework\spring-core\4.3.8.RELEASE\spring-core-4.3.8.RELEASE.jar;D:\开发工具\repository\org\yaml\snakeyaml\1.17\snakeyaml-1.17.jar;D:\开发工具\repository\org\springframework\boot\spring-boot-starter-tomcat\1.5.3.RELEASE\spring-boot-starter-tomcat-1.5.3.RELEASE.jar;D:\开发工具\repository\org\apache\tomcat\embed\tomcat-embed-core\8.5.14\tomcat-embed-core-8.5.14.jar;D:\开发工具\repository\org\apache\tomcat\embed\tomcat-embed-el\8.5.14\tomcat-embed-el-8.5.14.jar;D:\开发工具\repository\org\apache\tomcat\embed\tomcat-embed-websocket\8.5.14\tomcat-embed-websocket-8.5.14.jar;D:\开发工具\repository\org\hibernate\hibernate-validator\5.3.5.Final\hibernate-validator-5.3.5.Final.jar;D:\开发工具\repository\javax\validation\validation-api\1.1.0.Final\validation-api-1.1.0.Final.jar;D:\开发工具\repository\org\jboss\logging\jboss-logging\3.3.1.Final\jboss-logging-3.3.1.Final.jar;D:\开发工具\repository\com\fasterxml\classmate\1.3.3\classmate-1.3.3.jar;D:\开发工具\repository\com\fasterxml\jackson\core\jackson-databind\2.8.8\jackson-databind-2.8.8.jar;D:\开发工具\repository\org\springframework\spring-web\4.3.8.RELEASE\spring-web-4.3.8.RELEASE.jar;D:\开发工具\repository\org\springframework\spring-aop\4.3.8.RELEASE\spring-aop-4.3.8.RELEASE.jar;D:\开发工具\repository\org\springframework\spring-beans\4.3.8.RELEASE\spring-beans-4.3.8.RELEASE.jar;D:\开发工具\repository\org\springframework\spring-context\4.3.8.RELEASE\spring-context-4.3.8.RELEASE.jar;D:\开发工具\repository\org\springframework\spring-webmvc\4.3.8.RELEASE\spring-webmvc-4.3.8.RELEASE.jar;D:\开发工具\repository\org\springframework\spring-expression\4.3.8.RELEASE\spring-expression-4.3.8.RELEASE.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2017.2.6\lib\idea_rt.jar" cn.zhangbox.cloud.SpringCloudDemoApplication
  2. Connected to the target VM, address: '127.0.0.1:51282', transport: 'socket'
  3. 2018-07-13 17:13:30.459 INFO 8104 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@4416d64f: startup date [Fri Jul 13 17:13:30 GMT+08:00 2018]; root of context hierarchy
  4. 2018-07-13 17:13:30.983 INFO 8104 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
  5. 2018-07-13 17:13:31.057 INFO 8104 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$52bfc5ff] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
  6. . ____ _ __ _ _
  7. /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
  8. ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
  9. \\/ ___)| |_)| | | | | || (_| | ) ) ) )
  10. ' |____| .__|_| |_|_| |_\__, | / / / /
  11. =========|_|==============|___/=/_/_/_/
  12. :: Spring Boot :: (v1.5.3.RELEASE)
  13. 2018-07-13 17:13:31.835 INFO 8104 --- [ main] c.z.cloud.SpringCloudDemoApplication : The following profiles are active: dev
  14. 2018-07-13 17:13:31.850 INFO 8104 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@160396db: startup date [Fri Jul 13 17:13:31 GMT+08:00 2018]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@4416d64f
  15. 2018-07-13 17:13:32.470 INFO 8104 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=61cde5fe-b448-3350-a5e4-3ab1b78398ff
  16. 2018-07-13 17:13:32.489 INFO 8104 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
  17. 2018-07-13 17:13:32.553 INFO 8104 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$52bfc5ff] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
  18. 2018-07-13 17:13:33.018 INFO 8104 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8081 (http)
  19. 2018-07-13 17:13:33.032 INFO 8104 --- [ main] o.apache.catalina.core.StandardService : Starting service Tomcat
  20. 2018-07-13 17:13:33.034 INFO 8104 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.14
  21. 2018-07-13 17:13:33.199 INFO 8104 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
  22. 2018-07-13 17:13:33.199 INFO 8104 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1349 ms
  23. 2018-07-13 17:13:33.345 INFO 8104 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
  24. 2018-07-13 17:13:33.350 INFO 8104 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
  25. 2018-07-13 17:13:33.351 INFO 8104 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
  26. 2018-07-13 17:13:33.351 INFO 8104 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
  27. 2018-07-13 17:13:33.351 INFO 8104 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
  28. 2018-07-13 17:13:34.025 INFO 8104 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@160396db: startup date [Fri Jul 13 17:13:31 GMT+08:00 2018]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@4416d64f
  29. 2018-07-13 17:13:34.094 INFO 8104 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/dc],methods=[GET]}" onto public java.lang.String cn.zhangbox.cloud.controller.DcController.dc()
  30. 2018-07-13 17:13:34.098 INFO 8104 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
  31. 2018-07-13 17:13:34.099 INFO 8104 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
  32. 2018-07-13 17:13:34.142 INFO 8104 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
  33. 2018-07-13 17:13:34.142 INFO 8104 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
  34. 2018-07-13 17:13:34.189 INFO 8104 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
  35. 2018-07-13 17:13:34.555 WARN 8104 --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
  36. 2018-07-13 17:13:34.555 INFO 8104 --- [ main] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
  37. 2018-07-13 17:13:34.561 WARN 8104 --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
  38. 2018-07-13 17:13:34.561 INFO 8104 --- [ main] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
  39. 2018-07-13 17:13:34.697 INFO 8104 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
  40. 2018-07-13 17:13:34.707 INFO 8104 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'environmentManager' has been autodetected for JMX exposure
  41. 2018-07-13 17:13:34.708 INFO 8104 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'configurationPropertiesRebinder' has been autodetected for JMX exposure
  42. 2018-07-13 17:13:34.709 INFO 8104 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'refreshScope' has been autodetected for JMX exposure
  43. 2018-07-13 17:13:34.711 INFO 8104 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located managed bean 'environmentManager': registering with JMX server as MBean [org.springframework.cloud.context.environment:name=environmentManager,type=EnvironmentManager]
  44. 2018-07-13 17:13:34.726 INFO 8104 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located managed bean 'refreshScope': registering with JMX server as MBean [org.springframework.cloud.context.scope.refresh:name=refreshScope,type=RefreshScope]
  45. 2018-07-13 17:13:34.739 INFO 8104 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located managed bean 'configurationPropertiesRebinder': registering with JMX server as MBean [org.springframework.cloud.context.properties:name=configurationPropertiesRebinder,context=160396db,type=ConfigurationPropertiesRebinder]
  46. 2018-07-13 17:13:34.881 INFO 8104 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 0
  47. 2018-07-13 17:13:34.890 INFO 8104 --- [ main] o.s.c.n.eureka.InstanceInfoFactory : Setting initial instance status as: STARTING
  48. 2018-07-13 17:13:35.012 INFO 8104 --- [ main] com.netflix.discovery.DiscoveryClient : Initializing Eureka in region us-east-1
  49. 2018-07-13 17:13:35.418 INFO 8104 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON encoding codec LegacyJacksonJson
  50. 2018-07-13 17:13:35.418 INFO 8104 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON decoding codec LegacyJacksonJson
  51. 2018-07-13 17:13:35.554 INFO 8104 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML encoding codec XStreamXml
  52. 2018-07-13 17:13:35.554 INFO 8104 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML decoding codec XStreamXml
  53. 2018-07-13 17:13:35.935 INFO 8104 --- [ main] c.n.d.s.r.aws.ConfigClusterResolver : Resolving eureka endpoints via configuration
  54. 2018-07-13 17:13:36.021 INFO 8104 --- [ main] com.netflix.discovery.DiscoveryClient : Disable delta property : false
  55. 2018-07-13 17:13:36.022 INFO 8104 --- [ main] com.netflix.discovery.DiscoveryClient : Single vip registry refresh property : null
  56. 2018-07-13 17:13:36.022 INFO 8104 --- [ main] com.netflix.discovery.DiscoveryClient : Force full registry fetch : false
  57. 2018-07-13 17:13:36.022 INFO 8104 --- [ main] com.netflix.discovery.DiscoveryClient : Application is null : false
  58. 2018-07-13 17:13:36.022 INFO 8104 --- [ main] com.netflix.discovery.DiscoveryClient : Registered Applications size is zero : true
  59. 2018-07-13 17:13:36.023 INFO 8104 --- [ main] com.netflix.discovery.DiscoveryClient : Application version is -1: true
  60. 2018-07-13 17:13:36.023 INFO 8104 --- [ main] com.netflix.discovery.DiscoveryClient : Getting all instance registry info from the eureka server
  61. 2018-07-13 17:13:36.260 INFO 8104 --- [ main] com.netflix.discovery.DiscoveryClient : The response status is 200
  62. 2018-07-13 17:13:36.262 INFO 8104 --- [ main] com.netflix.discovery.DiscoveryClient : Starting heartbeat executor: renew interval is: 30
  63. 2018-07-13 17:13:36.266 INFO 8104 --- [ main] c.n.discovery.InstanceInfoReplicator : InstanceInfoReplicator onDemand update allowed rate per min is 4
  64. 2018-07-13 17:13:36.269 INFO 8104 --- [ main] com.netflix.discovery.DiscoveryClient : Discovery Client initialized at timestamp 1531473216269 with initial instances count: 26
  65. 2018-07-13 17:13:36.288 INFO 8104 --- [ main] o.s.c.n.e.s.EurekaServiceRegistry : Registering application cloud-demo with eureka with status UP
  66. 2018-07-13 17:13:36.289 INFO 8104 --- [ main] com.netflix.discovery.DiscoveryClient : Saw local status change event StatusChangeEvent [timestamp=1531473216289, current=UP, previous=STARTING]
  67. 2018-07-13 17:13:36.291 INFO 8104 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_CLOUD-DEMO/windows10.microdone.cn:cloud-demo:8081: registering service...
  68. 2018-07-13 17:13:36.342 INFO 8104 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_CLOUD-DEMO/windows10.microdone.cn:cloud-demo:8081 - registration status: 204
  69. 2018-07-13 17:13:36.360 INFO 8104 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8081 (http)
  70. 2018-07-13 17:13:36.360 INFO 8104 --- [ main] .s.c.n.e.s.EurekaAutoServiceRegistration : Updating port to 8081
  71. 2018-07-13 17:13:36.364 INFO 8104 --- [ main] c.z.cloud.SpringCloudDemoApplication : Started SpringCloudDemoApplication in 6.85 seconds (JVM running for 8.116)
  72. 2018-07-13 17:13:45.808 INFO 8104 --- [nio-8081-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring FrameworkServlet 'dispatcherServlet'
  73. 2018-07-13 17:13:45.809 INFO 8104 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization started
  74. 2018-07-13 17:13:45.838 INFO 8104 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization completed in 29 ms
  75. Services: [zcs-apps-gateway, mystore-user-jwt, eureka-feign-client, scca-server-all-in-one, oms-system, zcs-apps-config, apollo-adminservice, staryun-product, tm-web, gateway-server, config-server, apollo-configservice, base-service, hd-cloud-boss, wm-svr-gateway, tm-admin, gzepro-manage-service, cva, zcs-jzsy-ops-new, x-cbiz, hd-config-server, wm-app-basicmanager, cloud-demo, wm-app-authserver, service-configuration, api-gateway]

eureka管控台正常显示

浏览器输入地址:
http://eureka.didispace.com/

看到服务已经成功注册。

图片.png

当然,我们也可以通过直接访问eureka-client服务提供的/dc接口来获取当前的服务清单,只需要访问:http://localhost:2001/dc,我们可以得到如下输出返回:

  1. Services: [zcs-apps-gateway, mystore-user-jwt, eureka-feign-client, scca-server-all-in-one, oms-system, zcs-apps-config, apollo-adminservice, staryun-product, tm-web, gateway-server, config-server, apollo-configservice, base-service, hd-cloud-boss, wm-svr-gateway, tm-admin, gzepro-manage-service, cva, zcs-jzsy-ops-new, x-cbiz, hd-config-server, wm-app-basicmanager, cloud-demo, wm-app-authserver, service-configuration, api-gateway]

可以看到cloud-demo包含在里面。至此maven快速构建cloud项目并启动测试已全部完成。

源码地址:

SpringCloud使用Intellij中的maven来快速构建Spring Cloud工程

作者:星缘1314

链接:https://www.jianshu.com/p/8700851622ab

來源:简书

简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。

关注「编程微刊」公众号 ,在微信后台回复「领取资源」,获取IT资源300G干货大全。

公众号回复“1”,拉你进程序员技术讨论群.

SpringCloud核心教程 | 第二篇: 使用Intellij中的maven来快速构建Spring Cloud工程的更多相关文章

  1. SpringCloud核心教程 | 第一篇: 使用Intellij中的Spring Initializr来快速构建Spring Cloud工程

    spring cloud简介 spring cloud 为开发人员提供了快速构建分布式系统的一些工具,包括配置管理.服务发现.断路器.路由.微代理.事件总线.全局锁.决策竞选.分布式会话等等.它运行环 ...

  2. Springboot(一):使用Intellij中的Spring Initializr来快速构建Spring Boot工程

    使用Intellij中的Spring Initializr来快速构建Spring Boot工程 New---Project 可以看到图所示的创建功能窗口.其中Initial Service Url指向 ...

  3. 使用Intellij中的Spring Initializr来快速构建Spring Boot工程

    本文将介绍嵌入的Intellij中的Spring Initializr工具,它同Web提供的创建功能一样,可以帮助我们快速的构建出一个基础的Spring Boot/Cloud工程. 1.菜单栏中选择F ...

  4. SpringCloud核心教程 | 第三篇:服务注册与发现 Eureka篇

    Spring Cloud简介 Spring Cloud是一个基于Spring Boot实现的云应用开发工具,它为基于JVM的云应用开发中涉及的配置管理.服务发现.断路器.智能路由.微代理.控制总线.全 ...

  5. EnjoyingSoft之Mule ESB开发教程第二篇:Mule ESB基本概念

    目录 1. 使用Anypoint Studio开发 2. Mule ESB Application Structure - Mule ESB应用程序结构 3. Mule ESB Application ...

  6. Spring cloud系列教程第二篇:支付项目父工程图文搭建

    Spring cloud系列教程第二篇:支付项目父工程图文搭建 在讲解spring cloud相关的技术的时候,咱们就模拟订单支付这个流程来讲讲 在这个支付模块微服务搭建过程中,上面的这些技术,都会融 ...

  7. 在eclipse中使用maven构建spring cloud微服务

    使用eclipse中使用maven构建spring cloud微服务,springcloud通过maven构建项目.springcloud项目搭建. 工具/原料   eclipse maven spr ...

  8. IntelliJ 启动不同端口的两个spring cloud项目

    IntelliJ 启动不同端口的两个spring cloud项目 1,使用maven进行clean package 2,在Terminal界面,输入java -jar xxx.jar --server ...

  9. SpringCloud教程 | 第二篇: 服务消费者(rest+ribbon)

    在上一篇文章,讲了服务的注册和发现.在微服务架构中,业务都会被拆分成一个独立的服务,服务与服务的通讯是基于http restful的.Spring cloud有两种服务调用方式,一种是ribbon+r ...

随机推荐

  1. Android 五大存储方式具体解释

    SharedPreferences与Editor SharedPreferences保存的数据仅仅要是类似于配置信息格式的数据.因此它保存的数据主要是简单的key-value对形式.以下关系图 上图全 ...

  2. Android开发之蓝牙(Bluetooth)操作(一)--扫描已经配对的蓝牙设备

    版权声明:本文为博主原创文章,未经博主允许不得转载. 一. 什么是蓝牙(Bluetooth)? 1.1  BuleTooth是目前使用最广泛的无线通信协议 1.2  主要针对短距离设备通讯(10m) ...

  3. html 笔记2

    .css重用 <style> 如果整个页面的宽度 > 900px时: { .c{ 共有 } .c1{ 独有 } } .c2{ 独有 } </style> <div ...

  4. Android使用token维持登陆状态的方法

    什么是token token(令牌)是一串唯一的字符串,通常由服务端生成,在注册完成时返回给客户端,用来标识此用户,客户端将此字符串存储在本地.在以后的网络请求时,客户端先查询本地的token,如果有 ...

  5. 消息推送学习一、原生Socket的使用

    消息推送也是客户端和服务器连接然后进行交互的一种形式,但是不同于HTTP的连接,这种连接需要长时间的进行,当有消息时可以及时推送到客户端.除此之外还有多个用户,可能需要针对其身份进行不同的推送等等要求 ...

  6. 分享一段wap框架样式

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  7. Flex之文件目录浏览器实例

    Flex之文件目录浏览器实例 Flex的AIR项目 <?xml version="1.0" encoding="utf-8"?> <mx:Wi ...

  8. ES6学习笔记(五)函数的扩展

    1.函数参数的默认值 1.1基本用法 ES6 之前,不能直接为函数的参数指定默认值,只能采用变通的方法. function log(x, y) { y = y || 'World'; console. ...

  9. python编写PAT 1007 Maximum Subsequence Sum(暴力 分治法 动态规划)

    python编写PAT甲级 1007 Maximum Subsequence Sum wenzongxiao1996 2019.4.3 题目 Given a sequence of K integer ...

  10. poj Transferring Sylla(怎样高速的推断一个图是否是3—连通图,求割点,割边)

    Transferring Sylla 首先.什么是k连通图? k连通图就是指至少去掉k个点使之不连通的图. 题目: 题目描写叙述的非常裸.就是给你一张图要求你推断这图是否是3-连通图. 算法分析: / ...