杭州广告公司网站建设,文山北京网站建设,企业信息港网站建没,网站开发项目职责本项目是搭建基于nacos注册中心的springcloud#xff0c;使用zuul网关和gateway网关。
一、框架搭建
#xff08;1#xff09;项目结构 micro-service 服务提供者 zuul-gateway zuul网关 springcloud-gateway gateway网关
#xff08;2#xff09;环境
nacos 1.4.1…本项目是搭建基于nacos注册中心的springcloud使用zuul网关和gateway网关。
一、框架搭建
1项目结构 micro-service 服务提供者 zuul-gateway zuul网关 springcloud-gateway gateway网关
2环境
nacos 1.4.1
springboot 2.1.9
springcloud Greenwich
注nacos搭建 二、项目配置application.yaml
127.0.0.1:8848为本地nacos地址
1micro-service
spring:application:name: micro-serviceprofiles:active: devjackson:time-zone: GMT8date-format: yyyy-MM-dd HH:mm:ssdefault-property-inclusion: ALWAYScloud:nacos:discovery:server-addr: 127.0.0.1:8848server:port: 8081
2zuul-gateway
spring:application:name: zuul-gatewayprofiles:active: devjackson:time-zone: GMT8date-format: yyyy-MM-dd HH:mm:ssdefault-property-inclusion: ALWAYScloud:nacos:discovery:server-addr: 127.0.0.1:8848server:port: 8082zuul:strip-prefix: true #转发路径截断匹配前缀
# prefix: /apiadd-proxy-headers: falseset-content-length: truesemaphore:max-semaphores: 600hystrix:command:default:execution:isolation:thread:timeoutInMilliseconds: 120000
ribbon:ReadTimeout: 240000ConnectTimeout: 2000MaxAutoRetries: 0MaxAutoRetriesNextServer: 1eager-load:enabled: trueclients: micro-service
3 springcloud-gateway
spring:application:name: springcloud-gatewayprofiles:active: devjackson:time-zone: GMT8date-format: yyyy-MM-dd HH:mm:ssdefault-property-inclusion: ALWAYScloud:nacos:discovery:server-addr: 127.0.0.1:8848gateway:discovery:locator:enabled: truelower-case-service-id: truehttpclient:connect-timeout: 60000response-timeout: 5sroutes:- id: micro-service1uri: lb://micro-servicepredicates:- Path/micro-service1/**filters:- StripPrefix1
server:port: 8083hystrix:command:default:execution:isolation:thread:timeoutInMilliseconds: 120000
ribbon:ReadTimeout: 240000ConnectTimeout: 2000MaxAutoRetries: 0MaxAutoRetriesNextServer: 1eager-load:enabled: trueclients: micro-service 三、项目地址
https://github.com/90duc/springcloud-nacos