编程知识 cdmana.com

Corrigendum and source code download of the book "in depth understanding of spring cloud and microservice construction"

Reprint please indicate the source :
https://blog.csdn.net/forezp/article/details/79638403
This article from the Fang Zhipeng's blog

Click to get SpringCloud 、Spring Boot video

Corrigendum to article

Mistakes are inevitable , Welcome criticism , Leave a message at the bottom of the article . Add me wechat if you have any questions miles02, Because there are many people who may ask , It is suggested that the problem be described clearly , I have time to answer , Thank you for your support .
readers QQ Communication group :719761942

the number of pages Before the change After modification
p32 The last line @GetMappin It is amended as follows : @GetMapping
p49 20 That's ok Turn on RestControllerde It is amended as follows : Turn on RestController
p51 6 That's ok port: 9001 It is amended as follows :prot: 9091
p52 8 That's ok heath It is amended as follows : health
p55 10 That's ok Shut down the application It is amended as follows : close applications
p58 28 That's ok For the first time It is amended as follows : For the first time
p63 14 That's ok restfun style It is amended as follows : restful style
p74 11 That's ok Eureka Serve It is amended as follows :Eureka Server
p110 18 That's ok OKhHttp It is amended as follows : OkHttp
p116 12 That's ok Ask service system It is amended as follows : Microservice system
p125 11 That's ok clusterConfig It is amended as follows : appConfig
p138 31 That's ok Used as a eureka-client engineering dev It is amended as follows : Used as a config-client engineering dev
p140 15 That's ok eureka-server engineering It is amended as follows :config-server engineering
p145 1 That's ok Message broker build It is amended as follows : Message broker component
p155 Last but not least 5 That's ok Message generation components RabbitMQ It is amended as follows : Message broker component RabbitMQ
p161 The fifth to the last line ureka Client It is amended as follows : Eureka Client
p196 8 That's ok Oauth2 It is amended as follows :OAuth2
p225 14 That's ok Please check 11.3.4 section After modification : Please check 13.3.5 section
p119 9 Row sum 12 That's ok visit htpp://localhost:8765/hi It is amended as follows : visit htpp://localhost:8764/hi

The mistake that affects understanding is : p51 6 That's ok 、p125 11 That's ok 、p138 31 That's ok 、p140 15 That's ok 、p225 14 That's ok 、p119 9 Row sum 12 That's ok . I'm sorry for the trouble you've caused , I hope the readers can have more understanding .

p39 Last 2 The paragraph should read as follows :

eureka-server After the successful start of the project , start-up eureka-client engineering , You'll find in the console eureka-client Will send to http://localhost:8769 Read configuration file , Finally, the port that the program starts is 8762, This port is in eureka-server Of Resouces/shared In the catalog eureka-client-dev.yml File configuration , so eureka-client Successfully to eureka-server Profile read .
For further verification , stay eureka-clien Project write a API Interface , Read configuration file's foo Variable , And pass API Interface to return , The code is as follows :

Modified for ( The modified part is bold ):

eureka-server After the successful start of the project , start-up eureka-client engineering , You'll find in the console eureka-client Will send to http://localhost:8769 Read configuration file , Finally, the port that the program starts is 8762, This port is in config-server Of Resouces/shared In the catalog eureka-client-dev.yml File configuration , so eureka-client Successfully to config-server Profile read .
For further verification , stay eureka-client Project write a API Interface , Read configuration file's foo Variable , And pass API Interface to return , The code is as follows :
|

p82 The second code is changed to :

java –jar eureka-server-0.0.1-SNAPSHOT.jar            - -spring.profiles.active=peer1
java –jar eureka-server-0.0.1-SNAPSHOT.jar
- - spring.profiles.active=peer2

p172 The code fragment is modified to :

security:
  user:
    name: admin
    password: 123456

eureka:
  instance:
    metadata-map:
      user.name: admin
      user.password: 123456


p187 To make it easier to understand, the last paragraph of the page is revised to read :

After the application starts successfully , Access on Browser http://localhost:8080/blogs, As the page is affected by Spring Security Protect , Need to log in . Use the user name as admin, The password for 123456 Sign in , The user corresponding to the user name has “ADMIN” The role permissions of . After successful login , Page shows “/blogs/list” The interface of , The interface is shown in the figure 13-5 Shown .

Source download

github download :https://github.com/forezp/springcloud-book

Code cloud download : https://gitee.com/forezp/springcloud-book

Book purchase address

1.jpg

Click to buy books - JD.COM

Click to buy books - Dangdang

Click to buy books - Amazon


Code scanning, attention, surprise

( Please indicate the author and source of this article Fang Zhipeng's blog

版权声明
本文为[Fang Zhipeng]所创,转载请带上原文链接,感谢

Scroll to Top